如何乘以2位小数并具有良好的等效值 [英] How do I multiply 2 decimals and having the good equivalent
问题描述
我有4个带有2位数字的小数字段,A,B,C和D.当我试图将A * B乘以并将它们放入C时,C和D应该等于但它们不是。
使用小数字段的最佳做法是什么?
我尝试过:
示例:
我们有A = 3.34,B = 4.97,C = 16.60,D = 16.59并且来自验证规则我试图检查C和D是否等于但我没有这种情况,但实际上它们应该是等于。
提前谢谢。
实际上
A * B = 16.5998
现在你得到C = 16.60如果你将结果转换为2 nd 小数。
另一方面,如果截断结果为2 nd 小数,则得到C = 16.59
Hi, I have 4 Decimals fields with 2 digits, A, B, C and D. When I tried to multiply A*B and put them into C the C and D should be equals but they are not.
What is the best practice to use the Decimal Fields ?
What I have tried:
Example:
We have A=3.34, B=4.97, C=16.60, D=16.59 and from the Validation Rule I tried to check if the C and D are equals but I did not have the case, but actually they should be equals.
Thank you in advance.
Actually
A*B = 16.5998
Now you getC = 16.60if you round the result to the 2nd decimal.
On the other hand, you getC = 16.59if you truncate the result to the 2nd decimal.
这篇关于如何乘以2位小数并具有良好的等效值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!