[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

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

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
mariita
Asked:
mariita
1 Solution
 
Geert BormansCommented:
need to put quotes around it

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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