Page 2 of 2

Making it compatible to non-english versions of Windows

Posted: Tue Mar 08, 2005 3:33 am
by popper
Risser wrote:Here's what I came up with. Shamelessly cribbed from Pablo's Magic Nodes script.
Risser, thanks a lot for sharing this with us.

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
... and then change the following line:

Code: Select all

      
'formattedScore = FormatNumber(avgScore, 2)
formattedScore = FormatNumberInt(avgScore, 2)
popper

Posted: Mon Mar 03, 2008 5:30 pm
by istanbul
Would anyone be interested in updating this script for MM3?

Posted: Fri May 30, 2008 7:58 am
by crabby7
Would be great... I've posted a question in magic nodes thread to see if there was a chance to have it working within magic nodes.