News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Numbers as text - native English speakers please help

Started by jj2007, November 21, 2022, 11:17:36 AM

Previous topic - Next topic

jj2007

include \masm32\MasmBasic\MasmBasic.inc
  Init
  For_ ct=0 To 999
mov ecx, Rand(10000) ; 0...9999
PrintLine Str$(ecx), Tb$, NumberAsText$(ecx)
  Next
EndOfCode


Is the output correct?
140     one hundred and forty
2864    two thousand eight hundred and sixty-four
2343    two thousand three hundred and forty-three
1356    one thousand three hundred and fifty-six
7514    seven thousand five hundred and fourteen
7874    seven thousand eight hundred and seventy-four
882     eight hundred and eighty-two
5016    five thousand sixteen
3133    three thousand one hundred and thirty-three
8055    eight thousand fifty-five
2185    two thousand one hundred and eighty-five
2132    two thousand one hundred and thirty-two
7591    seven thousand five hundred and ninety-one
4322    four thousand three hundred and twenty-two
6005    six thousand five
1223    one thousand two hundred and twenty-three
7390    seven thousand three hundred and ninety
9797    nine thousand seven hundred and ninety-seven
1527    one thousand five hundred and twenty-seven
5905    five thousand nine hundred and five
6155    six thousand one hundred and fifty-five
136     one hundred and thirty-six
3443    three thousand four hundred and forty-three
2786    two thousand seven hundred and eighty-six
2795    two thousand seven hundred and ninety-five
6325    six thousand three hundred and twenty-five
192     one hundred and ninety-two
6845    six thousand eight hundred and forty-five
5678    five thousand six hundred and seventy-eight
5806    five thousand eight hundred and six
4017    four thousand seventeen
2806    two thousand eight hundred and six
9984    nine thousand nine hundred and eighty-four
8676    eight thousand six hundred and seventy-six
7142    seven thousand one hundred and forty-two
8183    eight thousand one hundred and eighty-three
3037    three thousand thirty-seven
840     eight hundred and forty
9385    nine thousand three hundred and eighty-five
3412    three thousand four hundred and twelve
3207    three thousand two hundred and seven
6778    six thousand seven hundred and seventy-eight
7843    seven thousand eight hundred and forty-three
4320    four thousand three hundred and twenty
9064    nine thousand sixty-four
6422    six thousand four hundred and twenty-two

zedd151

Looks okay, but also the format:
'two thousand one hundred eighty-five' rather than
'two thousand one hundred and eighty-five' is also acceptable.

An English teacher may object to either way though, but in practice and in normal conversation either way is okay imo.

or even 'twenty one hundred eighty five' has been used in certain circumstances. Or simply the format 'twenty one eighty five' has been used for dates for example. Youd say "nineteen seventy three", not "one thousand nine hundred and seventy three" for 1973 ... :biggrin:


As for true correctness, ???. Us Americans are kinda lazy with regard to using proper English.  :tongue:


To me, it depends on how verbose you want to be.  :greensml:

FORTRANS

Hi,

   I will go along with dropping the "and" in most cases.
And year dates are handled differently.  And most of this
is personal preference or some sort of local usage.  Go
with what feels right to you if it is understandable to all
"normal" users.

Regards,

Steve

jj2007

Thanks, Z and Steve :thup:

Being European, I will go with British English ;-)