Just wondering if this is a math issue, not formatting. Why do you divide the number of items by 1000? Do you want to divide milliseconds (difference variable) by 1000? Perhaps this is what you want:
EventRate := (List.Items.Count) / (difference / 1000); // events per second; to make it per minute, need to change 1000 to 60000
Of course, you still want to format the result. You will need this as a property of a variable or class:
MyFormatSettings: tformatsettings;
then you will need to do this once, for example. in FormShow:
getlocaleformatsettings(locale_system_default, MyFormatSettings);
finally this should work:
sb.panels[2].Text := format('%5.2f', EventRate, MyFormatSettings);
Argalatyr
source share