How to resolve notes rounding issues?

In my notes webform, I have some text fields and number fields. But some text field entered with number, I need to add these numbers in the text field and compare with other number field.So I create another hidden number computed field(with two decimal number in property) with formula such as: @If(textfield1=“”;0;@Round(@TextToNumber(textfield1);0.01)) + …,

But when I compare this total with other field, it is not always working, if I display the hidden field, I can see it equals with other number field. But it does not equal. in this case, if I add 0.1 to the total, it equals. I think this is the note rounding issue. Does anybody know how to resolve it? thanks a lot,

Subject: How to resolve notes rounding issues?

Welcome to the wonderful world of floating point numbers. It’s not a Notes/Domino problem; it’s fundamental to the nature of representing decimal numbers in binary form. There is no exact representation of 0.1 or 0.01 in binary, and how you create the number (did you convert from text, did you add two other numbers, etc.) can mean that two numbers that you think should be identical are not. Notes/Domino also uses standard (“banker’s”) rounding, where a 5 rounds to the nearest even number (so 0.015 and 0.025 both round to 0.02). Some languages use BCD (binary coded decimal) or a Currency data type (lots of bits to represent a number, which is then truncated rather than rounded) to get around the floating point binary problem. Formula Language only has @FloatEq, which will let you use a “close enough” value.

Subject: Was sad, now happy

I thought I’d post a link to a search in the 4/5 forum showing how old this question is…LINK IS GONE. So much history, blood, sweat, tears, laughter, revelation and just plain old good information gone in a puff of electrons…:frowning:

Hmmm…so the 6/7 ‘new’ link includes a link to the FAQs which include links to the 4/5 forum! Oh Frabjous Day :slight_smile:

Like the man said, not a Notes problem and a wicked old question.

http://www-10.lotus.com/ldd/46dom.nsf/search?SearchView&Query=round%20AND%20[_CreationDate]<1%2F1%2F2000&SearchOrder=1&SearchMax=0&SearchWV=TRUE&SearchFuzzy=TRUE&Start=1&Count=100

Subject: RE: Was sad, now happy

I boosted the count argument in your URL to get all 322 hits. What a trip down memory lane! Lots of familar names, though interestingly neither yours, mine, or Stan’s appear.

-rich