summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-04-09 15:02:25 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-11 17:26:45 -0700
commit360cd85445e325c64246128f5b1d5a67ac462426 (patch)
treed4753935a89b8323c474f0ad16f9a32aa8be895f /xslt
parente355037e20174eeaa734cebc10737005abbf74de (diff)
downloadsubsurface-360cd85445e325c64246128f5b1d5a67ac462426.tar.gz
Fix DivingLog import
DivingLog seems to report cylinder start and end pressures in metric format, but sample readings are in imperial in case user has selected this unit. So we must convert the sample pressures in this case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/DivingLog.xslt9
1 files changed, 8 insertions, 1 deletions
diff --git a/xslt/DivingLog.xslt b/xslt/DivingLog.xslt
index 15ad651a9..f7921f619 100644
--- a/xslt/DivingLog.xslt
+++ b/xslt/DivingLog.xslt
@@ -211,7 +211,14 @@
Until further information, just grab "randomly" the first
pressure reading -->
<xsl:attribute name="pressure">
- <xsl:value-of select="Press1"/>
+ <xsl:choose>
+ <xsl:when test="$depthUnit = 'imperial'">
+ <xsl:value-of select="concat(format-number((Press1 div 14.5037738007), '#.##'), ' bar')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="Press1"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
<xsl:attribute name="depth">
<xsl:call-template name="depthConvert">