vetha
vetha

Reputation: 3

XSLT 1.0 decimal number formatting for zero decimals and non zero decimals

hi i have set of inputs as below

22.00
25.25
25.56
56.15
85

and the output to be

22
25.25
25.56
56.15
85

any ideas would be appreciated!

Upvotes: 0

Views: 132

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 116992

It is hard to deduce the rule from your examples. Applying the number() function to the input will produce the results you show - perhaps that is what you want.


Added:

If you want the input of 1.20 to be preserved as 1.20, then you can test for the value of input mod 1 to separate the two cases - see the demo at: https://xsltfiddle.liberty-development.net/ncnu9B7

Upvotes: 2

Related Questions