This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @NumberToWords | |
ones = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] | |
tens = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] | |
scales = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion"] | |
convert: (num) -> | |
number = Math.abs(num) | |
return @check_negative(num, @convert_less_than_hundred number) if number < 100 | |
return @check_negative(num, @convert_less_than_thousand number) if number < 1000 | |
for n in [0..scales.length] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
"dojo/_base/declare", | |
"dojo/_base/lang", | |
"dojo/on", | |
"dojo/dom-construct", | |
"dojo/dom-style", | |
'dijit/form/SimpleTextarea', | |
"dijit/_WidgetBase" | |
], function ( | |
declare, |