Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding PROBLEM

Status
Not open for further replies.

simma

Programmer
Sep 11, 2001
398
US
Hello
How do I avoid rounding??
Thanx
 
don't divide :)

Seriously...you can set rounding in the numeric tab of the format of the field...but be ware...if this field is used in any calculations...it uses the actually value...the rounding in the numeric tab controls only the display of the numeric field...not how it is used in calculation.

otherwise the rounding function should be used.

Jim
 
Thanks!!
But the problem is when I am customising field(numeric) and the rounding part is alreay set to 10 digits.If I dont want to do any rounding at all what should I do?
 
Ok...I think I understand what you want....

You want all of your numeric fields to be set to the same rounding and display of decimals....yes?

Then go to File|options|Fields|Number

This is where the defaults for your reports are set. Create your definition of what you want a number to be like and then you can forget about it.(or just change to few that don't comply manually)

The warning on what happens in arithmetic operations with rounded-for-display numbers should be heeded though(previous post to you)...if you don't it then you will have grief tracking down a stupid rounding error.

hope this helps

Jim
 
Thanks!!
But I tried it already.Even if u go into defaluts,You can see rounding is set from 1 to 10 digits.I dont want any rounding at all!!So I'm finding ways not to round at all!!
 
When some people say they don't want rounding, they mean they want the precision of a number retained. Other people mean they want a number truncated at a certain point. Which is your preference? To ensure clarity for the simple minded like myself, please include an example.
 
Thanks for comments!I mean maintaining precision.For example if I have 4.822334567897 then I want it as it is!!!
 
ok...that is a different question...in playing around I see your problem as the totext function handles only 10 decimals maximum...as well displaying the number by itself has a 10 decimal max.

are you using it in a calculation....no problem as it keeps that number of decimal places.

for display purposes convert it to text using the following formula then display the result

************************* formula start ************
stringvar y;
numbervar a := 1.12345678901;
numbervar b;
numbervar c;

b := Truncate (a,10);
c := (a - b) * 100000000000;
y := totext(b,10) + totext(c,0);

y;
************************* formula start ************

kinda kludgey but it works. This multiplier used in the calculation of c will vary (10 zeros plus one for every decimalplace over 10 in the number...in this case there are 11 zeros)


interesting problem...have it remember my answer :)

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top