Re: number format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Balwantsingh wrote:
hello,

may pls. suggest me how i can retreive number before decimal and after
decimal.
for example 123456.7. I want to store 123456 in a variable and 7 in another.

also how can i force the user by validations so that he can only enter data
in this format only i.e. 123456.7.

thanks

with best wishes
balwant

Use explode()

$num = 123456.7;
$parts = explode(".", $num);
echo "$part[0]\n";
echo "$part[1]";

--
-- ShenKong (shenkong@xxxxxxx)
-- http://www.openphp.cn

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux