Risser, thanks a lot for sharing this with us.Risser wrote:Here's what I came up with. Shamelessly cribbed from Pablo's Magic Nodes script.
One little problem though: as in Pablo's script before version 1.2b, the formatting of the rating value will not work correctly when the default decimal delimiter is not a dot but a comma, like it is e.g. in Germany. So I, too, used a snippet from Pablo's Magic Nodes script to fix that problem.
Put the following below the "DummyFunct":
Code: Select all
Function FormatNumberInt(n, decimals)
Dim pos
pos = InStr(n,".")
If pos = 0 Then
FormatNumberInt = n & "." & String(decimals,"0")
Else
Dim oldDecimals
oldDecimals = Len(n) - pos
If decimals > oldDecimals Then
FormatNumberInt = n & String(decimals-oldDecimals,"0")
Else
FormatNumberInt = Left(n,pos+decimals)
End If
End if
End Function
Code: Select all
'formattedScore = FormatNumber(avgScore, 2)
formattedScore = FormatNumberInt(avgScore, 2)