Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to solve the round-off Issue?

ISSUE round-off
0
Posted

How to solve the round-off Issue?

0

Problem: When we round off the float value using format$() function it return value have the floating point issue. Example: pprint format$(“10.1″,1.75) ”Return 1.8 pprint format$(“10.1″,1.075) ”Return 1.07 In the above example the first pprint we are round 2 decimal points of 1.75 value using format$() function return 1.8 correct value, but the same format$() function is used to round off 2 decimal points of 1.075 return 1.07 wrong values , correct value is 1.08 . This is sample .01 floating point issue . Work-Around: When we are getting Floating issue, Please Use the following function behalf of use format$() function . It return the correct values. Function Call pprint FormatCurrency$(“10.1″,1.075) ”Return 1.08 Function Definition functionS FormatCurrency$(DimF Val) FormatCurrency$=format$(“10.2”,ROUND((val*1000)/10)/100) end function Note: This is not an VM Issue because we tried the same thing in C++ the same result we are getting .

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123