diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2013-12-28 09:05:32 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-28 07:40:22 -0800 |
commit | a88f413f70c149c0dc24647f18c80099bd841855 (patch) | |
tree | ae4c0066bb5b631a9bee0e2426234b46512a7409 /xslt | |
parent | abcc4d55bda509573016ceeda939a05bebc2e6de (diff) | |
download | subsurface-a88f413f70c149c0dc24647f18c80099bd841855.tar.gz |
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>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/commonTemplates.xsl | 12 |
1 files changed, 12 insertions, 0 deletions
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> |