From: Shawn P. <sha...@gm...> - 2009-01-12 22:44:40
|
This was brought up before. Isn't there a function that does something like that already? Somebody proposed something called format that would do what print using does in BASIC. One could extend printf to accept a dollar sign and or comma inside the percentage sign so to keep the minus sign off the dollar sign and to allow commas every three digits or in Asian countries every four. printf( 1, "$%.0f", { 13.00 } ) -- outputs $13 to the screen. We could extend this to accept: printf( 1, "$%,.0f", { 10000000 } ) -- $10,000,000 printf( 1, "$%_.0f", { 10000000 } ) -- $10_000_000 printf( 1, "%$.2f", { -104 } ) -- -$104.00 Using money is world portable. So, if you are chopping off decimals, its only the one extra mile to check to makesure there really is a decimal and to use the decimal symbol that money() will use, which may be a comma. If you don't care just use printf. Shawn Pringle 2009/1/12 Jeremy Cowgar <je...@co...> > Well, don't blame me, blame Microsoft, Linux and Apple who disagree with > you :-) It's their functions doing the formatting. > > Jeremy > |