Re: Novice Level Project - simple, fun and useful

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...
display("$ [:8,,.2]",n/100) 

Ugh, display(), ugh. Sorry, but there is no limit to the amount of scorn and vitriol I could pour on that sad excuse of a routine and it's illegitimate sibling, text_format(), pttth.
No doubt it has it's fans here, but if you don't believe me, just look for yourself at the docs or better yet the ridiculous and revolting source code, especially the latter, like some kind of weird regex on acid.
It is not and I have no plans to ever make it compatible with Phix, however the following dose of sanity will give exactly the same results (in Phix, but sadly not Eu):

printf(1,"$ %,8.2f\n",n/100) 

In fairness, for comparison, the latter is not exactly pretty either, but at least there is only one of it and it is far less than 1/4 the size, plus the above actually entirely depends upon a non-amendable (C) version of that anyway.
(The only thing Eu does not have is the comma handling, which is only like six lines of code anyway.)

PS OK, technically, display() runs fine (if that's a valid word here) on Phix, but I certainly ain't supporting or fixing or documenting it!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu