--
You received this message because you are subscribed to the Google Groups "PhpForAndroid" group.
To post to this group, send email to php-for...@googlegroups.com.
To unsubscribe from this group, send email to php-for-andro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/php-for-android?hl=en.
I have tried to echo using both (string)$val and number_format($val),
but it's not working on my android...
So I just wrote a dirty little function which seems to be working:
function float2string($value,$decimal_sign = "." ,$no_decs) {
return (int)$value . ( ($no_decs > 0)?
$decimal_sign .(int)(fmod($value,((int)$value)) * pow(10,$no_decs))
:
'');
}
$v = 5/4;
echo flaot2string($v,".",2);
// Will echo 1.25
Hope it helps until we wait for the next release with this issue solved.
Cheers!
--
Javier Infante Porro