mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
abcc4d55bd
commit
a88f413f70
1 changed files with 12 additions and 0 deletions
|
@ -153,4 +153,16 @@
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</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>
|
</xsl:stylesheet>
|
||||||
|
|
Loading…
Reference in a new issue