明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1472|回复: 4

[已解答] rtos 小数精度的问题

[复制链接]
发表于 2015-5-27 14:59 | 显示全部楼层 |阅读模式
(setq fmtval (rtos 17.5 2 2)) 出来的还是17.5 这是什么情况
发表于 2015-5-27 15:03 | 显示全部楼层
看看系统变量dimzin。
 楼主| 发表于 2015-5-27 15:32 | 显示全部楼层
ll_j 发表于 2015-5-27 15:03
看看系统变量dimzin。

搞定,非常感谢
发表于 2021-7-25 13:41 | 显示全部楼层
本帖最后由 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/A ... A-A910-E08522876414
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-6 21:16 , Processed in 0.173951 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表