I would like a mask function to format number (as string) like a lot of mask plugins do.
Desired behavior:
format('1') // '0,01'
format('12') // '0,12'
format('123') // '1,23'
format('12345678') // '123.456,78'
It would be better if the formatter achieve this using only regex functions.
[EDIT]
A searched a lot of questions here in stackoverflow but mostly answers consist in add two decimal cases at the end of string. That's not what I expected.
EXPECTED:
format('1') // '0,01'
format('123') // '1,23'
NOT EXPECTED:
format('1') // '1,00'
format('123') // '123,00'