Re: Suggestion for Eu 2.5

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 13 Jan 2004 06:12:38 +0000, Kurt Faasse
<darkside at frontiernet.net> wrote:

>More options for printf would be useful.  Large numbers could be 
>separated by commas at the appropriate places by putting a comma after 
>the percent sign, e.g. "%,d" to print 12345678 as 12,345,678.  Right now 
>I'm working on an astronomical program that involves huge distances, and 
>comma separated numbers would be easier on the eye.  I will have to 
>write a routine that prints the numbers with commas as a separate 
>function.  If printf had this built in, the speed price would be 
>negligible.

You may want to test my financial formatting routine (probably without
specifying a currency symbol). It is designed specifically that a
column of large digits align on the decimal point, and also allows K
or M indicators if the number is too large to fit in the specified
width. I does not handle exponents at all, though. Let me know if
there is some reasonable enhancement you think I could make.

Regards,
Pete
http://palacebuilders.pwp.blueyonder.co.uk/euphoria.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu