stig1 Posted June 1, 2009 Share Posted June 1, 2009 How do you count the number of value after the decimal point? For example 38.88 = 2 characters after the decimal point 38.88888 = 5 characters after the decimal point. Any ideas if this is possible? Quote Link to comment https://forums.phpfreaks.com/topic/160562-count-number-of-values-after-decimal-point/ Share on other sites More sharing options...
Alex Posted June 1, 2009 Share Posted June 1, 2009 $decimal = 56.578; $split = explode('.', $decimal); echo strlen($split[1]); Output: 3 Quote Link to comment https://forums.phpfreaks.com/topic/160562-count-number-of-values-after-decimal-point/#findComment-847393 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.