[PATCH 4/4] CSV import might have time in sec.fraction format

Miika Turkia miika.turkia at gmail.com
Wed Nov 9 11:39:26 PST 2016


Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/csv2xml.xslt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 3d7320d..a1b96c0 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -225,14 +225,14 @@
               </xsl:call-template>
             </xsl:when>
             <xsl:when test="number(translate($value, ',', '.')) = translate($value, ',', '.')">
-              <!-- We assume time in seconds -->
 
+              <!-- We assume time in seconds with possibly fractions -->
               <xsl:call-template name="sec2time">
                 <xsl:with-param name="timeSec">
                   <xsl:choose>
                     <xsl:when test="substring-after($value, '.') != ''">
                       <!-- Well, I suppose it was min.sec -->
-                      <xsl:value-of select="substring-before($value, '.') * 60 + substring-after($value, '.')" />
+                      <xsl:value-of select="substring-before($value, '.') * 60 + substring(substring-after($value, '.') * 60, 1, 2)" />
                     </xsl:when>
                     <xsl:when test="substring-after($value, ',') != ''">
                       <!-- Well, I suppose it was min.sec -->
-- 
2.5.0



More information about the subsurface mailing list