diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-02-26 21:21:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-02-26 11:30:32 -0800 |
commit | 0a1224b693eacd05dc7df847417a5cd9ba94e347 (patch) | |
tree | ab33c80bb48096fa1d71b1f076babef34d8215f8 /xslt/xml2manualcsv.xslt | |
parent | 0eb42b35b832a7e837dafcbc2eae89649e02a344 (diff) | |
download | subsurface-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.xslt | 9 |
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>"</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>"</xsl:text> |