我不想要圆形数字175 [英] I don't want round digit figure 175

查看:63
本文介绍了我不想要圆形数字175的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

this is digit 174.90





我已应用此水晶报告公式但结果是

只有一百七十五174.90(这是圆形的数字)





但我希望这个一百七十四美元和九十美分仅174.90

公式如下解决此问题



我尝试过:





I have applied this crystal report formula but result is
"One hundred seventy five only" 174.90 (This is round figure)


But i want this "One hundred seventy four dollar and ninety cent only" 174.90
formula is under below solve this issue

What I have tried:

if right(Towords({Invoice_Detail.After_Invoice_Discount_Total}),2)="00" 
then
Lcase(ToWords({Invoice_Detail.After_Invoice_Discount_Total},0))+" "+"only"
else 
Lcase(ToWords({Invoice_Detail.After_Invoice_Discount_Total},0))+" and "+Lcase(ToWords(tonumber(right(Totext({Invoice_Detail.After_Invoice_Discount_Total}),2)),0))+" "+" cent only"

推荐答案

将它乘以100,将其转换为整数。

然后使用除以和模数100将其分解为两个值为整数值。

然后编写一个ToWords方法,接受整数值并显示它们。



(整数在这里很重要,浮动值的存储意味着你不一定得到什么你想要浮点)。
Multiply it by 100, convert it to an integer.
Then break that into two values using divide by and modulus 100 into integer values.
Then write a ToWords method that accepts integer values and display them.

(Integer is important here, the storage of float values means you don't necessarily get what you want with floating point).


这篇关于我不想要圆形数字175的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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