[AccessD] Format to round to the thousand or million

Gustav Brock Gustav at cactus.dk
Thu Apr 20 05:07:43 CDT 2006


Hi all

Did you know that Format() will let you perform a 4/5 rounding to the thousands or millions etc.?
The trick is to append thousand separators to the format string:

curAmount = 3900725021.36

? Format(curAmount,"#,##0")
3,900,725,021

? Format(curAmount,"#,##0,")
3,900,725

? Format(curAmount,"#,##0,,")
3,901

? Format(curAmount,"#,##0,,,")
4

The same format strings can be applied as Format property of a Textbox.

/gustav




More information about the AccessD mailing list