Solved

How to specify the number of decimal places if input is not a string

Posted on 2013-05-24
1
397 Views
Last Modified: 2013-05-24
How can I specify the number of decimal places to be displayed if the input parameter is a decimal? I tried using the XSLT format-number function, but the function expects a string.

<xsl:variable name="SQM_Cement_Production_CO2nonbio_Emission_Quantity" select="sum(/Report/Report_Detail/Sources/SQM/Cement_Production/SummationOfCO2/CO2_From_Non_Biomass_Quantity[. castable as xs:double])"/>

<xsl:value-of select="format-number($SQM_Cement_Production_CO2nonbio_Emission_Quantity, 0.0000)"/>
0
Comment
Question by:mariita
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39194191
need to put quotes around it

<xsl:value-of select="format-number($SQM_Cement_Production_CO2nonbio_Emission_Quantity, '0.0000')"/>
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Which XML parser should I used for my requirement 11 76
Checkbox and ListView in Android Layout 4 76
Transform XML to Excel using XSL 1 33
Eliminate additional border 1 22
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 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