package timedesc
OCaml date time handling library
Install
Dune Dependency
Authors
Maintainers
Sources
timedesc-1.1.0.tar.gz
sha256=2be785e3a8699748d79433b655a66412642dc380391a5643f8997e6c193bbfff
doc/timedesc/Timedesc/Span/For_human/index.html
Module Span.For_human
Source
Source
type error = [
| `Invalid_days of int
| `Invalid_hours of int
| `Invalid_minutes of int
| `Invalid_seconds of int
| `Invalid_ns of int
]
Source
type error_f = [
| `Invalid_days_f of float
| `Invalid_hours_f of float
| `Invalid_minutes_f of float
| `Invalid_seconds_f of float
| `Invalid_ns of int
]
Constructors
Source
val make :
?sign:sign ->
?days:int ->
?hours:int ->
?minutes:int ->
?seconds:int ->
?ns:int ->
unit ->
(t, error) result
sign
defaults to `Pos
.
Returns Error
if any of the arguments are negative.
Source
val make_exn :
?sign:sign ->
?days:int ->
?hours:int ->
?minutes:int ->
?seconds:int ->
?ns:int ->
unit ->
t
Source
val make_frac :
?sign:sign ->
?days:float ->
?hours:float ->
?minutes:float ->
?seconds:float ->
?ns:int ->
unit ->
(t, error_f) result
sign
defaults to `Pos
.
Returns Error
if any of the arguments are negative.
Source
val make_frac_exn :
?sign:sign ->
?days:float ->
?hours:float ->
?minutes:float ->
?seconds:float ->
?ns:int ->
unit ->
t
Viewer
Pretty printing
Pretty printing for span. * * Default format string:
{days-nz: days }{hours-nz:X hours }{mins-nz:X mins }{secs:X}{sec-frac:.X} secs
Format string specification:
{{ literal { {days:unit} number of days unit is the string used after the number to denote its unit {days-nz:unit} same as above, but does not display if number is zero {hours:cXunit} number of hour, sub-day character 'c' before 'X' is used for padding (leave out character for no padding) unit is the string used after the number to denote its unit {hours-nz:cXunit} same as above, but does not display if number is zero {mins:cXunit} number of minutes, sub-hour character 'c' before 'X' is used for padding (leave out character for no padding) unit is the string used after the number to denote its unit {mins-nz:cXunit} same as above, but does not display if number is zero {secs:cXunit} number of seconds, sub-minute character 'c' before 'X' is used for padding (leave out character for no padding) unit is the string used after the number to denote its unit {secs-nz:cXunit} same as above, but does not display if number is zero {sec-frac:cNXunit} fraction of second, sub-second N determines the number of digits to take after decimal separator if N is not specified, then the smallest number of digits required after decimal separator for a lossless representation is used character c is used as the decimal separator unit is the string used after the number to denote its unit {secs-frac-nz:cNXunit} same as above, but does not display if nanosecond count is zero
*
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page