Based on the Gist by johnteske: https://gist.github.com/johnteske/aab61e8a43ca54dc30ac04888a29cbf1
My implementation uses the same thousand seperator routine, but extends it by allowing decimals and conversion of u.s. (i.e. 1,000.00) to european (i.e. 1.000,00) notation. In this implementation the default values are set to european style, which is easily adaptable in the liquid template via parameters or in the include by setting the defaults
The number you want to display, expected integer or decimal format i.e.
1
3459
12450.45
3.5
7.000304
How many decimal places you want to display, expected 0 to 10 max (code can be adapted to allow more than 10)
The thousands separator, defaults to '.'
The decimal separator, default to ','