0

HI neel
I want to convert integer value of variable to float ie. i am adding two variables and the addition is integer and i want convert it to float
eg:
$var1=30;
$var2=40;
$var3=$var1+$var2;


i want to display var3 as 70.00
please tell me how to do this
Thank you

4
Contributors
4
Replies
18
Views
8 Years
Discussion Span
Last Post by Elbert_1
0

number_format function is good one and you can use

floatval($var3

floatval fuction is did not show .00 (null) value,
but it will show .1 like ....

0

HI neel
I want to convert integer value of variable to float ie. i am adding two variables and the addition is integer and i want convert it to float
eg:
$var1=30;
$var2=40;
$var3=$var1+$var2;


i want to display var3 as 70.00
please tell me how to do this
Thank you

It worked,Thanks sir

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.