From a88f413f70c149c0dc24647f18c80099bd841855 Mon Sep 17 00:00:00 2001 From: Miika Turkia <miika.turkia@gmail.com> Date: Sat, 28 Dec 2013 09:05:32 +0200 Subject: Add depth conversions to XSLT Convert depth to and from mm. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org> --- xslt/commonTemplates.xsl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xslt/commonTemplates.xsl b/xslt/commonTemplates.xsl index 5c3da408b..a238d1117 100644 --- a/xslt/commonTemplates.xsl +++ b/xslt/commonTemplates.xsl @@ -153,4 +153,16 @@ </xsl:choose> </xsl:template> + <xsl:template name="depth2mm"> + <xsl:param name="depth"/> + + <xsl:value-of select="format-number(substring-before($depth, ' '), '#.##') * 1000"/> + </xsl:template> + + <xsl:template name="mm2depth"> + <xsl:param name="depth"/> + + <xsl:value-of select="concat(floor($depth div 1000), '.', format-number($depth mod 1000, '00'))"/> + </xsl:template> + </xsl:stylesheet> -- cgit v1.2.3-70-g09d2