forked from GitHub/gf-rgl
The new Decimal API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
concrete NumeralEus of Numeral = CatEus [Numeral,Digits] ** open Prelude, ResEus, ParamX in {
|
||||
concrete NumeralEus of Numeral = CatEus [Numeral,Digits,Decimal] ** open Prelude, ResEus, ParamX in {
|
||||
|
||||
oper LinDigit : Type = { s : DForm => Str ;
|
||||
n : Number ;
|
||||
@@ -112,5 +112,18 @@ lin D_9 = mkDig "9" ;
|
||||
lin IDig dig = dig ;
|
||||
-- : Dig -> Digits -> Digits ;
|
||||
lin IIDig dig digs = digs ** {s = \\co => glue (dig.s ! co) (digs.s ! co) } ;
|
||||
lin PosDecimal d = d ** {hasDot=False} ;
|
||||
lin NegDecimal d = {
|
||||
s = \\co => glue "-" (d.s ! co) ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
lin IFrac d i = {
|
||||
s = \\co => d.s ! co ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! co ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user