diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-04-09 15:02:25 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-11 17:26:45 -0700 |
commit | 360cd85445e325c64246128f5b1d5a67ac462426 (patch) | |
tree | d4753935a89b8323c474f0ad16f9a32aa8be895f | |
parent | e355037e20174eeaa734cebc10737005abbf74de (diff) | |
download | subsurface-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>
-rw-r--r-- | xslt/DivingLog.xslt | 9 |
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"> |