diff --git a/extra/math/text/english/english.factor b/extra/math/text/english/english.factor index 6ed17354a4..7f5387cb2c 100644 --- a/extra/math/text/english/english.factor +++ b/extra/math/text/english/english.factor @@ -91,6 +91,8 @@ SYMBOL: and-needed? PRIVATE> -: number>text ( n -- str ) - dup zero? [ small-numbers ] [ [ (number>text) ] with-scope ] if ; +GENERIC: number>text ( n -- str ) + +M: integer number>text + [ "zero" ] [ [ (number>text) ] with-scope ] if-zero ; diff --git a/extra/math/text/french/french.factor b/extra/math/text/french/french.factor index 78af45c66b..5b6f9039a3 100644 --- a/extra/math/text/french/french.factor +++ b/extra/math/text/french/french.factor @@ -90,5 +90,7 @@ MEMO: units ( -- seq ) ! up to 10^99 PRIVATE> -: number>text ( n -- str ) - dup abs 10 102 ^ >= [ number>string ] [ basic ] if ; +GENERIC: number>text ( n -- str ) + +M: integer number>text + dup abs 102 10^ >= [ number>string ] [ basic ] if ;