Commas used for decimal points: switch to periods within Rhino?

It finally dawned on me that numerous problems people have been having with my plugin all stem from users being in countries that use commas for decimals rather than periods.

I can ask them to switch their computer to use periods. But is there a way to do this in Rhino automatically? For instance, the code below I’d like to return with a period rather than a comma (for scripting purposes):

Dim TestPoint = new point3d(5.5, 0,0)
return TestPoint.x.tostring

Suggestions?

Thank you,
Sam

Hi @samlochner,

This from Python. But you’ll get the idea.

import Rhino
import System

point = Rhino.Geometry.Point2d(5.5, 0.0)

culture = System.Globalization.CultureInfo.InvariantCulture
print(point.X.ToString(culture))

– Dale

1 Like

That works, thanks Dale!