kumarb
kumarb

Reputation: 535

roundoff value to decimal 2 place with floor value

I am looking for help from XQuery experts where I need to round off values of a variable to 2 decimal places along with floor value like below.

say I am getting a variable value like 750.006 - value should be upto 2 decimal place. I am able to achieve that with help of below query.

fn-bea:format-number((xs:decimal($InputValue)),'0.00')

Now the issue is, I would like to have 3rd decimal digit to a floor value like say if

could someone please help me on this.

Upvotes: 1

Views: 1678

Answers (1)

Leo Wörteler
Leo Wörteler

Reputation: 4241

You can use fn-bea:decimal-round($value, $scale) to round the value before formatting it:

fn-bea:format-number(fn-bea:decimal-round(xs:decimal($InputValue), 2),'0.00')

Upvotes: 4

Related Questions