Solved

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

Posted on 2013-05-24
1
401 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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