A telephone banking system reads account balances out loud to customers. The text to speech engine behind it cannot pronounce numbers, so every amount has to reach it already written out in English words.
Convert one currency value between -$999999999999.99 and $999999999999.99 to words. None of the bank customers are trillionaires just yet.
Both parts of the amount are always written, so a dollar amount of 0 becomes zero dollars and a cent amount of 0 becomes zero cents. The following rules apply.
twenty-one and ninety-nine.and follows the word hundred in every case except a round hundred. Compare one hundred thousand with one hundred and twenty-three thousand.and goes between the smallest written group among billions, millions and thousands and the units group when the units group is less than one hundred and is not 0. Compare two thousand and forty-six with two thousand five hundred and fifty-seven.dollars follows the dollar amount, except when the dollar amount is exactly 1, where the word is dollar.and goes between the dollar amount and the cent amount.cents follows the cent amount, except when the cent amount is exactly 1, where the word is cent.in debit, and a positive value ends with in credit.in debit nor in credit.The only spellings needed are zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million, billion.
The first line holds the value v, written as a minus sign for a negative value, then $, then the dollar amount with no digit separators, then ., then exactly two digits for the cents.
The dollar amount has no leading zero unless it is 0. The value satisfies -999999999999.99 ≤ v ≤ 999999999999.99, and a value of zero is given as $0.00 with no minus sign.
Print the amount in English words on one line, with a single space between words.