Move math.text to math.text.english for localization
parent
4c6cb412f3
commit
947e64c630
|
@ -1,5 +1,5 @@
|
||||||
USING: help.markup help.syntax math strings ;
|
USING: help.markup help.syntax math strings ;
|
||||||
IN: math.text
|
IN: math.text.english
|
||||||
|
|
||||||
HELP: number>text
|
HELP: number>text
|
||||||
{ $values { "n" integer } { "str" string } }
|
{ $values { "n" integer } { "str" string } }
|
|
@ -1,4 +1,4 @@
|
||||||
USING: math.functions math.text tools.test ;
|
USING: math.functions math.text.english tools.test ;
|
||||||
IN: temporary
|
IN: temporary
|
||||||
|
|
||||||
[ "Zero" ] [ 0 number>text ] unit-test
|
[ "Zero" ] [ 0 number>text ] unit-test
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: combinators.lib kernel math math.functions math.parser namespaces
|
USING: combinators.lib kernel math math.functions math.parser namespaces
|
||||||
sequences splitting sequences.lib ;
|
sequences splitting sequences.lib ;
|
||||||
IN: math.text
|
IN: math.text.english
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
|
@ -26,10 +26,7 @@ IN: math.text
|
||||||
|
|
||||||
SYMBOL: and-needed?
|
SYMBOL: and-needed?
|
||||||
: set-conjunction ( seq -- )
|
: set-conjunction ( seq -- )
|
||||||
first {
|
first { [ dup 100 < ] [ dup 0 > ] } && and-needed? set drop ;
|
||||||
[ dup 100 < ]
|
|
||||||
[ dup 0 > ]
|
|
||||||
} && and-needed? set drop ;
|
|
||||||
|
|
||||||
: negative-text ( n -- str )
|
: negative-text ( n -- str )
|
||||||
0 < "Negative " "" ? ;
|
0 < "Negative " "" ? ;
|
||||||
|
@ -100,4 +97,3 @@ PRIVATE>
|
||||||
] [
|
] [
|
||||||
[ (number>text) ] with-scope
|
[ (number>text) ] with-scope
|
||||||
] if ;
|
] if ;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Convert integers to English text
|
|
@ -1 +0,0 @@
|
||||||
Convert integers to text
|
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (c) 2007 Aaron Schaefer.
|
! Copyright (c) 2007 Aaron Schaefer.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: combinators.lib kernel math.ranges math.text sequences strings ;
|
USING: combinators.lib kernel math.ranges math.text.english sequences strings ;
|
||||||
IN: project-euler.017
|
IN: project-euler.017
|
||||||
|
|
||||||
! http://projecteuler.net/index.php?section=problems&id=17
|
! http://projecteuler.net/index.php?section=problems&id=17
|
||||||
|
|
Loading…
Reference in New Issue