jester626 Posted October 30, 2007 Share Posted October 30, 2007 I have a DB where some fields are of the FLOAT nature. The Data that gets put into these field are 1.000, 1.500.1.250 etc. When I go to display them on PHP page I want to be able to drop any trailing zeros. Can anyone give me some insight on how to do this? Thanks, Jester Quote Link to comment https://forums.phpfreaks.com/topic/75369-solved-drop-trailing-zeros/ Share on other sites More sharing options...
Dragen Posted October 30, 2007 Share Posted October 30, 2007 $var = rtrim($var, '0'); where $vAr is the variable with zeros Quote Link to comment https://forums.phpfreaks.com/topic/75369-solved-drop-trailing-zeros/#findComment-381206 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.