Logo GenPRES

ValueUnit Module

Writes a ValueUnit as exact fractions or as decimals with a precision of 3, and holds the operator helpers.

Nested modules

Modules Description

Operators

Holds the ValueUnit constants 0, 1, 2 and 3 and an active pattern that recognises an operator as multiplication, division, addition or subtraction.

Functions and values

Function or value Description

toStr exact

Full Usage: toStr exact

Parameters:
    exact : bool - Whether the exact values should be printed

Returns: ValueUnit -> string

Print a ValueUnit to a string with a given precision of 3

exact : bool

Whether the exact values should be printed

Returns: ValueUnit -> string
Example

 [| 1N/3N |] |> ValueUnit.create  Units.Mass.milliGram |> toStr false
 // returns "0,333 mg"
 [| 1N/3N |] |> ValueUnit.create  Units.Mass.milliGram |> toStr true
 // returns "1/3 mg"

Type something to start searching.