[PATCH] JDiveLog import fallback for 1 digit numbers

Linus Torvalds torvalds at linux-foundation.org
Tue Nov 27 07:16:33 PST 2012


That isn't right, if I read the patch correctly.

You can't use "less than ten" to check for two digits.

1.01 is clearly one minute and one second, but 01 is less than ten, so now
you'll treat it as a decimal value, not as seconds.

But maybe I read that xslt wrong?

          Linus
On Nov 26, 2012 8:39 PM, "Miika Turkia" <miika.turkia at gmail.com> wrote:

> Use the decimal time format fallback also for one digit numbers as
> Linus suggested. Thus 1.1 min would result in 1 min 6 sec.
>
> Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
> ---
>  xslt/jdivelog2subsurface.xslt |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xslt/jdivelog2subsurface.xslt b/xslt/jdivelog2subsurface.xslt
> index 4e3d5a4..d8a850b 100644
> --- a/xslt/jdivelog2subsurface.xslt
> +++ b/xslt/jdivelog2subsurface.xslt
> @@ -387,8 +387,8 @@ Comment: <xsl:value-of select="Comment"/>
>          </xsl:when>
>          <xsl:otherwise>
>            <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 test="substring-after($timeSec, '.') >= 60 or
> substring-after($timeSec, '.') < 10">
> +              <xsl:value-of select="concat(substring-before($timeSec,
> '.'), ':', format-number(round(substring-after(format-number($timeSec,
> '.00'), '.') * .6), '00'), ' min')"/>
>              </xsl:when>
>              <xsl:otherwise>
>                <xsl:value-of select="concat(substring-before($timeSec,
> '.'), ':', format-number(substring-after($timeSec, '.'), '00'), ' min')"/>
> --
> 1.7.9.5
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20121127/178364b1/attachment-0001.html>


More information about the subsurface mailing list