mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Handle seconds in decimal notation (from JDiveLog)
This is a hack to convert time stored in decimal notation to proper seconds. When using metric units the default way of JDiveLog to store seconds is to have the amount of seconds after decimal point (1.20 is 1 minute 20 seconds). In some odd case it is reportedly possible that the seconds are actually 100 based, thus we need to convert that to seconds (1.33333 will become 1 minute 20 seconds). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ffa3fd551c
commit
e544ca5f6a
1 changed files with 8 additions and 1 deletions
|
@ -348,7 +348,14 @@ Comment: <xsl:value-of select="Comment"/>
|
|||
<xsl:value-of select="concat(floor(number($timeSec) div 60), ':', format-number(floor(number($timeSec) mod 60), '00'), ' min')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat(substring-before($timeSec, '.'), ':', format-number(substring-after($timeSec, '.'), '00'), ' min')"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-after($timeSec, '.') >= 60">
|
||||
<xsl:value-of select="concat(substring-before($timeSec, '.'), ':', round(substring-after(format-number($timeSec, '.00'), '.') * .6), ' min')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat(substring-before($timeSec, '.'), ':', format-number(substring-after($timeSec, '.'), '00'), ' min')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
|
|
Loading…
Add table
Reference in a new issue