推算货币价值四舍五入的方法 [英] Recommendable way of rounding up currency values

查看:226
本文介绍了推算货币价值四舍五入的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先看到以下问题:

SetRoundMode(rmUp)和四舍五入的round值,如10,结果为10,0001。

我需要将货币汇率上调,所以0.8205成为0.83,但上面显示的SimpleRoundTo行为给了我一些头疼。

I need to round currency values up, so 0.8205 becomes 0.83, but the SimpleRoundTo behavior displayed above is giving me some headaches.

我以一种安全的方式来计算货币价值?

How can I round currency values up in a safe way?

推荐答案

您可以使用Ceil功能:

You can use the Ceil function:

newvalue := Ceil(oldvalue * 100) / 100;

这篇关于推算货币价值四舍五入的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆