package safemoney

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Zv.SSource

Sourceval make : string -> t

Construction

Constructing Z by using a private type, create a Z value from string, e.g. from_str "123". Reason behind is to disallow a range of functions that are unsuitable for currency operations. For convenience the function alias make_z can be used.

Sourcetype showable = {
  1. value : string;
}

showable for t

Sourceval showable_to_yojson : showable -> Yojson.Safe.t
Sourceval sexp_of_showable : showable -> Sexplib0.Sexp.t
Sourceval showable_of_sexp : Sexplib0.Sexp.t -> showable
Sourceval neg : t -> t

Negate a Z value

Sourceval abs : t -> t

Return an absolute Z value

Sourceval signum : t -> int

Return the sign of Z value, -1, 0, or 1 when the argument is respectively negative, null, or positive.

Sourceval add : t -> t -> t

Add two Z values

Sourceval sub : t -> t -> t

Substract two Z values

Sourceval mul : t -> t -> t

Multiply two Z values

Sourceval to_str : t -> string

Convert a Z value to string

Sourceval to_float : t -> float

Convert a Z value to float

Sourceval to_showable_json : t -> string

Convert a Q value to printable rep