找回密码
 注册
查看: 2382|回复: 1

如何用脚本实现数字的四舍五入

[复制链接]
发表于 2006-8-29 16:55:19 | 显示全部楼层 |阅读模式
怎么编写数字的四舍五入啊?
比如:

0.22222=0.222
0.22299=0.223

请求大家的帮助
谢谢
 楼主| 发表于 2006-8-30 13:27:24 | 显示全部楼层
Think you very much.

Now I have a better method to get it.
#printf $.3f 0.222999
#printf $.3f 0.222333

The above two commands work well. And thank you for your answer.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-11 18:58 , Processed in 0.021527 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

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