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: That property is only for display
So you might THINK you are comparing 0.45 with 0.45 but one of them might have 0.449
Use @round (or round in lotusscript) to really set things to two dec places
Subject: I did try @round… but
yes, you are right, that is the case.if you see my post, you should see that I did use @round(…;0.01) to keep only 2 decimals. but it does not work. now, I am trying to use other hidden number computed fields with 2 decimals property to capture those text fields with @round formula in it. Not sure if this work, I need more testing, since each way, it works form some cases, but not all of them. please let me know if you have any good idea.
Subject: total first ? round after
Hi,
Are you rounding every value and doing addition after ?
@Round(@TextToNumber(textfield1);0.01)) + …<= ?
I guess : @Round(@TextToNumber(textfield1);0.01)) + @Round(@TextToNumber(textfield2);0.01)) +
Maybe you should do the opposite :
@Round( @TextToNumber(textfield1) + @TextToNumber(textfield2) + … );0.01)
Subject: it seems on the correct track…
Thanks a lot for your help, you solution seems on the correct track. this is what I did so far:I have 4 text fields with number on it, I added 4 number hidden computed fields for each text field, and each number field of it has property of 2 decimal number currency setup with formula of like this: @If(textfield1=“”;0; @Round(@TextToNumber(textfield1);0.01)),
I also created another computed hidden field to total these 4 number fields with the formula of:
@Round((textfield1+textfield2+textfield3+textfield4);0.01)
And I use the total field to do the comparation with other number field.
You can see taht This is not exactly as you mentioned, I used the @Round in each hidden number hidden field, and I do the second @Round in the second total field. I tested it, it seems working fine, if it is not working, then I will remove the first Round from each hidden number fields.
Please let me know if you have any other suggestion. thanks a lot again.