package safemoney

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

Module Discrete.ScaleSource

Sourceexception ValidScaleError of string
Sourcetype t = {
  1. symbol_ : string;
    (*

    currency symbol

    *)
  2. sub_unit_ : string;
    (*

    currency unit name

    *)
  3. value_ : Q.t;
    (*

    scale value in rational

    *)
}

Types

Type of scale

Almost every currency has a unit value and sub unit values e.g. Pound is unit value for GBP with a scale of 1 to 1 Penny is sub unit value for GBP with scale of 100 to 1

Sourceval make_scale : sym:string -> sub_unit:string -> Q.t -> t

Construction

make_scale symbol subunit qv makes exchange rate, e.g. make_scale "GBP" "penny" make_q("100/1")

Sourceval to_json : t -> Yojson.Safe.t

to_json t converts t to json

Sourceval to_sexp : t -> Base.Sexp.t

to_sexp t converts t to sexp