Description
The functx:total-minutes-from-duration function returns the total number of minutes in $duration . If it is an uneven number of minutes, it will return a fractional part. This function is different from the built-in fn:minutes-from-duration function because the latter will normalize the value and only give you the remainder number of minutes between 1 and 60. For example, fn:minutes-from-duration(xs:dayTimeDuration("PT90M30S")) will return 30 , while functx:total-minutes-from-duration(xs:dayTimeDuration("PT90M30S")) will return 90.5 . If $duration is the empty sequence, the empty sequence is returned.
Arguments and Return TypeName | Type | Description |
$duration |
xs:dayTimeDuration? |
the duration |
return value |
xs:decimal? |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:total-minutes-from-duration" as="xs:decimal?"
xmlns:functx="http://www.functx.com">
<xsl:param name="duration" as="xs:dayTimeDuration?"/>
<xsl:sequence select="
$duration div xs:dayTimeDuration('PT1M')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:total-minutes-from-duration(
xs:dayTimeDuration('PT90M')) |
90 |
functx:total-minutes-from-duration(
xs:dayTimeDuration('PT1H90M')) |
150 |
functx:total-minutes-from-duration(
xs:dayTimeDuration('PT3H')) |
180 |
functx:total-minutes-from-duration(
xs:dayTimeDuration('PT1M30S')) |
1.5 |
See AlsoHistory |
Recommended Reading:
|