simeonC Posted March 25, 2014 Share Posted March 25, 2014 //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 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? 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 did you remove the comment marks ? and call the function thats where the problem occurs 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. 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
Archived
This topic is now archived and is closed to further replies.