aboutsummaryrefslogtreecommitdiffstats
path: root/xslt/xml2manualcsv.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-02-26 21:21:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-26 11:30:32 -0800
commit0a1224b693eacd05dc7df847417a5cd9ba94e347 (patch)
treeab33c80bb48096fa1d71b1f076babef34d8215f8 /xslt/xml2manualcsv.xslt
parent0eb42b35b832a7e837dafcbc2eae89649e02a344 (diff)
downloadsubsurface-0a1224b693eacd05dc7df847417a5cd9ba94e347.tar.gz
Fix imperial conversion for weight on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/xml2manualcsv.xslt')
-rw-r--r--xslt/xml2manualcsv.xslt9
1 files changed, 8 insertions, 1 deletions
diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt
index 82f4979d4..6064a4c72 100644
--- a/xslt/xml2manualcsv.xslt
+++ b/xslt/xml2manualcsv.xslt
@@ -182,7 +182,14 @@
<xsl:value-of select="$fs"/>
<xsl:text>&quot;</xsl:text>
<xsl:if test="weightsystem">
- <xsl:value-of select="concat(sum(xt:node-set($trimmedweightlist)/node()), ' kg')"/>
+ <xsl:choose>
+ <xsl:when test="$units = 1">
+ <xsl:value-of select="concat(format-number((sum(xt:node-set($trimmedweightlist)/node()) div 0.453592), '#.##'), ' lb')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(sum(xt:node-set($trimmedweightlist)/node()), ' kg')"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
<xsl:text>&quot;</xsl:text>