Solved

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

Posted on 2009-07-12
3
1,498 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

809 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