mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-30 02:58:35 -06:00
The new Decimal API
This commit is contained in:
+15
-1
@@ -1,4 +1,4 @@
|
||||
concrete NumeralGre of Numeral = CatGre [Numeral,Digits] ** open ResGre,Prelude in {
|
||||
concrete NumeralGre of Numeral = CatGre [Numeral,Digits,Decimal] ** open ResGre,Prelude in {
|
||||
|
||||
flags coding= utf8 ;
|
||||
|
||||
@@ -291,6 +291,20 @@ Xilias : CardOrd -> (CardOrd => Str) -> Number -> Str = \co,d,n ->
|
||||
D_8 = mk2Dig "8" Pl;
|
||||
D_9 = mk2Dig "9" Pl ;
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {
|
||||
s = \\o => "-" ++ BIND ++ d.s ! o ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
IFrac d i = {
|
||||
s = \\o => d.s ! NCard Neut Nom ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
|
||||
oper
|
||||
|
||||
mk3Dig : Str -> Number -> TDigit = \c,n -> {
|
||||
|
||||
Reference in New Issue
Block a user