Here's a copy of the code I used to convert numbers to decimals. Sorry it's from a phone screen shot, I'm not at the computer.
Long code for the return value function so you don't have to type it manually:
right(left(zeropad(round(Function.Param(0)),maxdigits),maxdigits-9),clamp(len(str(round(Function.Param(0))))-9,0,3)) &(len(str(round(Function.Param(0)))) > 9 ? seperator : "") &right(left(zeropad(round(Function.Param(0)),maxdigits),maxdigits-6),clamp(len(str(round(Function.Param(0))))-6,0,3)) &(len(str(round(Function.Param(0)))) > 6 ? seperator : "") & right(left(zeropad(round(Function.Param(0)),maxdigits),maxdigits-3),clamp(len(str(round(Function.Param(0))))-3,0,3)) &(len(str(round(Function.Param(0)))) > 3 ? seperator : "") &right(mid(zeropad(round(Function.Param(0)*10),maxdigits) ,maxdigits-4,3),clamp(len(str(round(Function.Param(0))))-0,0,3))
Then you need to set the text to the global variable of your numbers, e.g coins or hearts, but with the function and the variable instead of just the variable like this
Hope this helps, if you need desktop screen shots or an example .c3p file let me know and I'll sort it out tomorrow when I'm on the computer