FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Removing insignificant decimal characters?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Removing insignificant decimal characters? [message #169487 is a reply to message #169485] Wed, 15 September 2010 01:57 Go to previous messageGo to previous message
MikeB is currently offline  MikeB
Messages: 65
Registered: September 2010
Karma:
Member
Greg Russell wrote:
> In news:4c900b5f$1(at)news(dot)x-privat(dot)org,
> MikeB<mpbrede(at)gmail(dot)com> typed:
>
>> eg. I'd like the function to print
>>
>> 300 bytes iso 300.00 bytes
>>
>> and
>>
>> 4 Kb iso 4.00 Kb.
>>
>> Any hints as to how I can do this?
>
> Use printf(). See
> http://us2.php.net/manual/en/function.printf.php
>
>

I'm using sprintf, which accepts the same inputs as printf. What I can't
grog is how to make the insignificant .00 to not print. The way I read
the sprintf formatting, I can't see how to do zero-suppression on
trailing decimal digits.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: getting amount of deleted rows from: $result=odbc_exec($conn, 'delete from....');
Next Topic: echo other way to output a constant?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 06:58:04 GMT 2024

Total time taken to generate the page: 0.06850 seconds