How to convert digital numerals (1, 2, 3) into number words ('one', 'two', 'three')?

8 visualizzazioni (ultimi 30 giorni)
I have input data like:
1
2
3
4
13
15
23
and I want the output like:
one
two
three
four
thirteen
fifteen
twenty three
  13 Commenti
Walter Roberson
Walter Roberson il 7 Mag 2023
Okay, what the University of Oxford style guide says is,
Spell out whole-number words for one to ten; use figures for numbers above ten.
Cambridge ... talks about it indirectly, It is conventional for STM titles to have numbers written out up to 10 and for H&SS titles to have numbers to be written out up to 100. -- if we understand "STM titles" to refer to any discussion of Science, Technology and Mathematics, and "H&SS titles" to refer to dicussions of Humanities and Social Sciences
BBC says to spell out (only) single digits, except in headlines single digits may be given numerically, but spell out "millions"and "billions" except in currencies or headlines, but that the numbers that start a sentence must be spelled out (including for headlines)
So... if we go by the reference sources you picked out, then neither one thousand and one hundred nor one thousand one hundred are acceptable, unless they happen to be the first word in a sentence or headline, in which case no rule is given about using or not-using and
Stephen23
Stephen23 il 7 Mag 2023
Modificato: Stephen23 il 7 Mag 2023
"So... if we go by the reference sources you picked out, then neither one thousand and one hundred nor one thousand one hundred are acceptable, unless they happen to be the first word in a sentence or headline, in which case no rule is given about using or not-using and"
Descriptions of English grammar (as related to numbers) are certainly available from reputable sources. For example:
Also by teaching resources from reputable sources:
which explicitly states "Don’t use the word and to join millions and thousands or thousands and hundreds:"
Also by some reputable style guides (which in general are not grammar references, just... style guides):
These make it clear that "and" before tens/ones is a normal, standard, documented part of British English (the same also applies to Commonwealth English) and Canadian English. However, the BBC learning material explicitly states that the use of "and" between thousands and hundreds, as in your example, is not allowed in standard British English. The British English grammar rules are also very neatly explained in algorithmic form here:
Note how when recombining with thousands and higher (with tens/ones) the word "and" is explicitly used only in the absence of hundreds (because the construct you used with "and" linking thousands and hundreds is not used in British English or Commonwealth English). All sources I have for British English are consistent with this: in ten years of writing and maintaining NUM2WORDS and WORDS2NUM (with over one thousand referenced test-cases sourced online from around twenty-five websites and from grammar books, this topic just happens to be something I have read a lot about) no reputable grammar or teaching reference I have read has mentioned such a thing. No engineer or mathematician I have ever worked with or listened to, has used such a construct:
https://www.youtube.com/watch?v=Wim9WJeDTHQ -> "... thousand, eight hundred and ninety-nine"
https://www.youtube.com/watch?v=q6L06pyt9CA -> "four thousand, nine hundred"
So far every example of "and" between thousands and hundreds seems to be an error by non-native speakers or poetic.
So naturally I am very curious how you came up with that example: what specific English dialect or region does that?

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by