|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Re: Re: Re: Using (s)printf()by Iphigenie (Initiate) |
| on Oct 09, 2001 at 10:39 UTC ( [id://117689]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
What if you want to chop a number but not round it? printf just *wants* to round, no option to tell it not to :( I needed something that would chop the extra digits (price calculataions) without rounding. quick fox was to compare the sprintf result with the original and if it was larger remove 0.01 - yuk!... I ended up using split and substr... - not pretty either There must be a better way!
In Section
Tutorials
|
|
||||||||||||||||||||||||