我正在使用CATIA vb脚本,正在从模型中获取点的坐标并将其写入文本文件中。在将其写入文本文件时,我想以德语编号格式编写,其中“。”。读为“,”。
谢谢!!
使用Replace()更改“。” 到 ”,”:
>> d = 1234.56
>> s = CStr(d)
>> g = Replace(s, ".", ",")
>> WScript.Echo d, s, g
>>
1234,56 1234.56 1234,56
FormatNumber()允许更花哨的启动效果/结果:
>> 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
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句