Author: Erwin Molendijk
How do I format a integer into a nice format. Eg. 1,200,000
Answer:
Lots of people don't realise this, but FormatFloat can be used to format integers
as well:
1 i := 1200000;
2 s := FormatFloat('#,0', i);
3 Memo1.lines.add(s);
This will display a formated version of 1200000. If you live in the USA you will get "1,200,000". Depending on the local settings of your Windows environment you might get "1.200.000" (eg you live in The Netherlands). You can also make different formats for negative numbers. Just checkout the Help on FormatFloat.