simeonC Posted March 25, 2014 Share Posted March 25, 2014 (edited) //function numeral(a){ raw = 100; var fix = raw.toFixed(2); //returns 2489.82 alert(fix); var too_string= new String(fix); var combine = "$"+too_string; alert(combine); //return(combine); //} When I remove the comment marks the function toFixed(2) do not work Edited March 25, 2014 by simeonC Quote Link to comment https://forums.phpfreaks.com/topic/287270-do-tofixed-work-within-a-function/ Share on other sites More sharing options...
requinix Posted March 25, 2014 Share Posted March 25, 2014 Works for me. What's the complete code that isn't working, and how is it not working? Quote Link to comment https://forums.phpfreaks.com/topic/287270-do-tofixed-work-within-a-function/#findComment-1473871 Share on other sites More sharing options...
simeonC Posted March 25, 2014 Author Share Posted March 25, 2014 (edited) did you remove the comment marks ? and call the function thats where the problem occurs Edited March 25, 2014 by simeonC Quote Link to comment https://forums.phpfreaks.com/topic/287270-do-tofixed-work-within-a-function/#findComment-1473875 Share on other sites More sharing options...
requinix Posted March 25, 2014 Share Posted March 25, 2014 Yes. That's what "it works for me" means: I did the thing you said that wasn't working but it worked. Quote Link to comment https://forums.phpfreaks.com/topic/287270-do-tofixed-work-within-a-function/#findComment-1473880 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.