oneTen method
String
oneTen(
- dynamic number
)
Implementation
String oneTen(number) {
number = int.parse('$number');
var value = "صفر";
if (number <= 12) {
switch (number) {
case 0:
value = ones["0"];
break;
case 1:
value = ones["1"];
break;
case 2:
value = ones["2"];
break;
case 3:
value = ones["3"];
break;
case 4:
value = ones["4"];
break;
case 5:
value = ones["5"];
break;
case 6:
value = ones["6"];
break;
case 7:
value = ones["7"];
break;
case 8:
value = ones["8"];
break;
case 9:
value = ones["9"];
break;
case 10:
value = ones["10"];
break;
case 11:
value = ones["11"];
break;
case 12:
value = ones["12"];
break;
}
} else {
var first = getNth(number, 0, 0);
var second = getNth(number, 1, 1);
if (tens[first] == "عشر") {
value = ones[second] + " " + tens[first];
} else {
value = ones[second] + " و" + tens[first];
}
}
return value;
}