List Info

Thread: Re: inserting a decimal




Re: inserting a decimal
country flaguser name
United States
2008-03-23 12:05:39

Thanks, I had come up with the same solution - dividing by 100 and
then using sprintf

--- In php-list%40yahoogroups.com">php-listyahoogroups.com, "Gordon Stewart&quot; <gordonisnz...> wrote:
&gt;
> On Mon, Mar 24, 2008 at 4:53 AM, David <dgresser...> wrote:
&gt; > Hi
> >
>; > I am trying to insert a decimal point two places from the right
end of
> > a string so 100 would become 1.00 I have tried using
number_format and
> > printf but I get 100.00
&gt; >
>; > Any suggestions?
>
> If your starting number is ALWAYS a whole number, you can divide by
100..
>
> Or would you sometimes have
>;
> 67.7 and want to get 6.77 (for example)...
>
>
> --
> G
> NZ community groups - community...
>; Freecycle Auckland br> > http://groups.yahoo.com/group/AucklandFreecycle/
>

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )