如何使用 CATIA vb 脚本在文本文件中以德语编号格式写入坐标?

How to write co-ordinates in German numbering format in a text file using CATIA vb script?

我正在使用 CATIA vb 脚本,我正在从模型中获取点的坐标并将其写入文本文件。在将其写入文本文件时,我想以德语编号格式编写,其中“。”读作“,”。

谢谢!!

使用Replace()更改“.”到“,”:

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

FormatNumber() 允许更花哨的 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