|
Posted by Justin Koivisto on 11/18/03 11:44
monomaniac21 wrote:
> I have a php code that generates numbers. sometimes is generates whole
> numbers but most of the time decimals. How can I, when it generates a
> whole number, convert the number to n.0
> where n is the whole number?
>
> For example 23 := 23.0
$int = 23;
$float = floatval($int);
If you mean for just output purposes:
printf('%.1f',$int);
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
Navigation:
[Reply to this message]
|