Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confiforms: Rounding calculated values during registration

its moi
Contributor
June 24, 2020

I have a form, with a field that is calculated during registration / entry. This is done with Rules for field definition >> set expression 

Total=([entry.qty]*[entry.value]/100)

And I need the result to be rounded to 2 decimals. But I do not get this to work. I am wondering where I have to set the rounding, and how. As far as I understood, the rounding can be used in form field macros. If I apply this to the form field macro in registration control, this does not work ... help appreciated :) 

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
June 24, 2020

Have a look at the math operations supported by ConfiForms in expressions - https://wiki.vertuna.com/display/CONFIFORMS/Supported+math+operators%2C+formulas+and+functions

hint: ROUND is also supported

its moi
Contributor
June 24, 2020

I have seen that @Alex Medved _ConfiForms_ but still cannot get it to work. I tried to apply this to the form field macro in registrations control, in which the expression is set by rules for field definition. 

ROUND(fieldname,2) 

Or do I need to add this to the formula in Rules for field Definition which does the calculation and sets the expression? 

Alex Medved _ConfiForms_
Community Champion
June 24, 2020

Not sure what is this what you have...

ROUND(fieldname,2) 

but the formula to ROUND will be something like

Total=(ROUND([entry.qty]*[entry.value]/100, 2))

or

Total=(SCALE([entry.qty]*[entry.value]/100, 2))

depends what you need exactly with the value you have calculated 

its moi
Contributor
June 24, 2020

Thanks @Alex Medved _ConfiForms_ - the last one for the Formula did it. (y)

I tried that before but had it like which did not do the trick 

Total=(ROUND([entry.qty]*[entry.value]/100), 2)
Alex Medved _ConfiForms_
Community Champion
June 24, 2020

Sorry, not really sure I understand your comment... Could you please rephrase it? Something still does not work for you?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events