Count the actual decimal digits for import

Apply the decimal time conversion hack for JDiveLog import if there are
less than 2 digits in the decimal part (and value is less than 60).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2012-11-27 18:14:15 +02:00 committed by Dirk Hohndel
parent 2ee26caba4
commit 7259cf5bb6

View file

@ -349,7 +349,7 @@ Comment: <xsl:value-of select="Comment"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="substring-after($timeSec, '.') &gt;= 60 or substring-after($timeSec, '.') &lt; 10">
<xsl:when test="substring-after($timeSec, '.') &gt;= 60 or string-length(substring-after($timeSec, '.')) &lt; 2">
<xsl:value-of select="concat(substring-before($timeSec, '.'), ':', format-number(round(substring-after(format-number($timeSec, '.00'), '.') * .6), '00'), ' min')"/>
</xsl:when>
<xsl:otherwise>