yjycad 发表于 2014-6-19 14:18:50

怎么改成保留3位小数啊?谢谢

本网站此这个程序怎么改成提取X,Y为3位小数啊?谢谢!

gzxl 发表于 2014-6-19 14:18:51

本帖最后由 gzxl 于 2014-6-19 16:03 编辑

(setq txtx (- txtx1 wx))
==>
(setq txtx (rtos (- txtx1 wx) 2 3))

(setq txty (+ txty1 wy))
==>
(setq txty (rtos (+ txty1 wy) 2 3))

(setq txtz (cdr (assoc 1 ssdata)))
==>
(setq txtz (rtos (atof (cdr (assoc 1 ssdata))) 2 3))

yjycad 发表于 2014-6-19 17:42:24

gzxl 发表于 2014-6-19 14:18 static/image/common/back.gif
(setq txtx (- txtx1 wx))
==>
(setq txtx (rtos (- txtx1 wx) 2 3))


非常感谢!

77077 发表于 2014-6-20 00:07:20

atof 多看书
页: [1]
查看完整版本: 怎么改成保留3位小数啊?谢谢