0

I am working with CATIA vb script and I am getting the co-ordinates of the points from the model and writing it in a text file. While writing it in a text file I want to write in German numbering format, where "." is read as ",".

Thank you!!

user3714887
  • 77
  • 3
  • 16

1 Answers1

3

Use Replace() to change "." to ",":

>> d = 1234.56
>> s = CStr(d)
>> g = Replace(s, ".", ",")
>> WScript.Echo d, s, g
>>
1234,56 1234.56 1234,56

FormatNumber() allows a more fancy startegy/result:

>> d = 1234.56
>> s = FormatNumber(d, 3, True, False, True)
>> g = Replace(Replace(Replace(s, ".", "*"), ",", "."), "*", ",")
>> WScript.Echo d, s, g
>>
1234,56 1,234.560 1.234,560
Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96