getTextForNumberLessThan100 method

String getTextForNumberLessThan100(
  1. int number
)

Implementation

String getTextForNumberLessThan100(int number) {
  if (number > 99) return '';
  //print( '/////////////////////////////${getMappingForNumber(number).isNotEmpty}/////////////////');
  if (getMappingForNumber(number).isNotEmpty)
    return getMappingForNumber(number);
  // if (number < 10)
  //   return getMappingForNumber(number);

  var onesPlace = (number % 10).toInt();
  var onesPlaceText = getMappingForNumber(onesPlace);

  var tensPlace = ((number - onesPlace) % 100).toInt();
  var tensPlaceText = getMappingForNumber(tensPlace);
  if (onesPlaceText.isNotEmpty) tensPlaceText += ' ';

  if(langu =='ar'){
    return onesPlaceText +" "+_numberMappings.mappings[0].toString()+" "+ tensPlaceText ;
  }

  return tensPlaceText + onesPlaceText ;
}