Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1830
  • Last Modified:

How to remove or strip a decimal point and figure after decimal point in xsl template?

I need to know how I can remove or strip a decimal point and figure after decimal point in xsl template?

See xsl value below:

<xsl:value-of select="qty/order">

and the output example is

"1.000"

I need to just get "1"
0
DavidO84
Asked:
DavidO84
  • 2
1 Solution
 
Geert BormansCommented:
<xsl:value-of select="substring-before(qty/order, '.')">
0
 
Geert BormansCommented:
nicer is to treat is as a number
<xsl:value-of select="floor(qty/order)">
the difference is in the negative numbers
if the number would be "-7.9"
first solution will return "-7"
second solution will returen "-8"
0
 
DavidO84Author Commented:
Worked perfectly and very easy to understand thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now