mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-07-01 03:28:34 -06:00
The new Decimal API
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../prelude:../abstract:../common
|
||||
|
||||
concrete NumeralCgg of Numeral = CatCgg [Numeral,Digits] **
|
||||
concrete NumeralCgg of Numeral = CatCgg [Numeral,Digits,Decimal] **
|
||||
open ResCgg, Prelude in {
|
||||
|
||||
lincat
|
||||
@@ -100,6 +100,16 @@ lin pot3plus n m = let
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {s=\\o,a=>"-" ++ BIND ++ d.s ! o ! a; hasDot=False; n = Pl} ;
|
||||
IFrac d i = {
|
||||
s=\\o,a=>d.s ! NCard ! a ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o ! a ;
|
||||
hasDot=True;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
oper
|
||||
commaIf : DTail -> Str = \t -> case t of {
|
||||
T3 => BIND ++ "," ++ BIND ;
|
||||
|
||||
Reference in New Issue
Block a user