暗夜贵族 发表于 2015-5-27 14:59:49

rtos 小数精度的问题

(setq fmtval (rtos 17.5 2 2)) 出来的还是17.5 这是什么情况

ll_j 发表于 2015-5-27 15:03:17

看看系统变量dimzin。

暗夜贵族 发表于 2015-5-27 15:32:40

ll_j 发表于 2015-5-27 15:03 static/image/common/back.gif
看看系统变量dimzin。

搞定,非常感谢

guankuiwu 发表于 2021-5-13 21:10:24

搞定!谢谢。

sfzyr 发表于 2021-7-25 13:41:56

本帖最后由 sfzyr 于 2021-7-25 13:45 编辑

Converting Real Numbers to a String with Linear Units Format
The rtos function converts a real value to a string. The format of the result string can be specified using the arguments of the function, or by the AutoCAD LUNITS and LUPREC system variables then when not provided. The AutoCAD DIMZIN system variable controls how leading and trailing zeros are written to the result string.

The following example code demonstrates the use of rtos and the values returned (assuming the AutoCAD DIMZIN system variable equals 0). Precision (the third argument to rtos) is set to 4 places in the first call and 2 places in the others.
这个是CAD帮助文件中的描述。
参考这个帮助文件:https://help.autodesk.com/view/AMECH_PP/2021/CHS/index.html?guid=GUID-A38E30D4-684E-44FA-A910-E08522876414

lijunfa12345 发表于 2024-9-30 16:17:58

谢谢分享。。。
页: [1]
查看完整版本: rtos 小数精度的问题