Lokolo Posted May 9, 2007 Share Posted May 9, 2007 Currently in my DB table i store the funds as a numeric so 1000, or 101000 - but how do I put a comma in? Simple as really but no idea how to do it heh. thanks, Link to comment https://forums.phpfreaks.com/topic/50633-solved-101000-101000-ie-big-numbered-currency/ Share on other sites More sharing options...
paul2463 Posted May 9, 2007 Share Posted May 9, 2007 FORMAT(X,D) Formats the number X to a format like '#,###,###.##', rounded to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part. mysql> SELECT FORMAT(12332.123456, 4); -> '12,332.1235' mysql> SELECT FORMAT(12332.1,4); -> '12,332.1000' mysql> SELECT FORMAT(12332.2,0); -> '12,332' with compliments of the <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_format"> MYSQL MANUAL </a> Link to comment https://forums.phpfreaks.com/topic/50633-solved-101000-101000-ie-big-numbered-currency/#findComment-248886 Share on other sites More sharing options...
Lokolo Posted May 9, 2007 Author Share Posted May 9, 2007 oh nice one, guess i gotta learn those good old string functions... Link to comment https://forums.phpfreaks.com/topic/50633-solved-101000-101000-ie-big-numbered-currency/#findComment-248913 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.