How to get the decimal part alone from a float number.

How to get the decimal part alone from a float number.
for eg : $x= 15.25
what to get .25 from $x

Thanks in advance.
LWord
lwordAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
$x= 15.25;
$f = $x - (int)$x;
0
 
Richard QuadlingSenior Software DeveloperCommented:
$f = fmod($x, 1);
0
 
Richard QuadlingSenior Software DeveloperCommented:
Oh!

Hadn't been answered as I typed in my response.

Oh!
0
 
Richard QuadlingSenior Software DeveloperCommented:
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Interesting answer, RQuadling. will try to remember that...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.