Solved

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

Posted on 2009-07-12
3
1,449 Views
Last Modified: 2013-11-18
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
Comment
Question by:DavidO84
  • 2
3 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24837555
<xsl:value-of select="substring-before(qty/order, '.')">
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 24837576
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
 

Author Closing Comment

by:DavidO84
ID: 31602690
Worked perfectly and very easy to understand thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now