I have looked at various documentation and similar questions on here, but cannot seem to find the particular solution. Apologies if I have missed anything obvious or have repeated this question! As a bit of background info, I have implemented 4 graphs using the Chart.js plugin and passed in the required data using PHP from a database. This is all
Tag: string-formatting
Add commas or spaces to group every three digits
I have a function to add commas to numbers: Unfortunately, it doesn’t like decimals very well. Given the following usage examples, what is the best way to extend my function? Presumably the easiest way is to first split on the decimal point (if there is one). Where best to go from there? Answer Just split into two parts with ‘.’