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,5 +1,5 @@
|
||||
|
||||
concrete NumeralAmh of Numeral = CatAmh [Numeral,Digits] ** open ResAmh,ParamX,Prelude in {
|
||||
concrete NumeralAmh of Numeral = CatAmh [Numeral,Digits,Decimal] ** open ResAmh,ParamX,Prelude in {
|
||||
flags coding = utf8;
|
||||
lincat
|
||||
|
||||
@@ -91,6 +91,18 @@ lin pot3plus n m = {
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mk2Dig "9" "9ኛ";
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {
|
||||
s = \\o,g,n,s,c => "-" ++ BIND ++ d.s !o!g!n!s!c ;
|
||||
hasDot=False
|
||||
} ;
|
||||
IFrac d i = {
|
||||
s = \\o,g,n,s,c => d.s!NCard!Masc!Sg!Indef!c ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o ! g ! n ! s ! c;
|
||||
hasDot=True
|
||||
} ;
|
||||
|
||||
oper
|
||||
commaIf : DTail -> Str = \t -> case t of {
|
||||
T3 => BIND++","++BIND ;
|
||||
|
||||
Reference in New Issue
Block a user