infosounds Posted September 11, 2014 Share Posted September 11, 2014 My code is$answer = (1/212500);output is4.90205690308E-6while I need I output as0.00000470588Please help, and tell me what is the specific problem, Link to comment https://forums.phpfreaks.com/topic/290993-is-there-anyone-could-solve-my-math-problem/ Share on other sites More sharing options...
Richard_Grant Posted September 11, 2014 Share Posted September 11, 2014 you need to be using a float datatype. 4.90205690308E-6 is exponential. Link to comment https://forums.phpfreaks.com/topic/290993-is-there-anyone-could-solve-my-math-problem/#findComment-1490723 Share on other sites More sharing options...
mac_gyver Posted September 11, 2014 Share Posted September 11, 2014 scientific notation is just another way of representing a floating point value. to get the output formatted the way you want - $answer = sprintf('%.11F',1/212500); @Richard_Grant, the large image in your signature is in violation of the forum's rules. i suggest you remove it or make it much smaller before you receive warning for it. Link to comment https://forums.phpfreaks.com/topic/290993-is-there-anyone-could-solve-my-math-problem/#findComment-1490725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.