[Homework] Convert number to its text

i have a problem converting 1=one 2= two ... until 999= nine hundred ninety nine can some one help me

Did you try a google search ? https://groups.google.com/g/mitappinventortest/c/IXXE2LFeA6Q/m/7B7BnuqaBgAJ

Try this, it can convert number to text and text to number :

Aia Project :
ConvertNumberToText.aia (3.1 KB)

this sounds like a homework task... what did you try? and where exactly do you have problems?
you might understand, that it does not make sense, if somebody else does the work for you, does it?

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Why not so ?

This is not as easy as it sounds. You also need "eleven", "twelve" etc in your list, you cannot convert that to one. two etc. You need to have a list with twenty, thirty, etc. and hundred needs to be somewhere too.
So yes, Google would be a good start, if you know JavaScript or some other programming language.

Here is a way to do a conversion of numbers to words with a WebViewer and javascript https://www.thoughtco.com/how-to-convert-numbers-to-words-with-javascript-4072535

Various algorithms in various scripting languages https://www.geeksforgeeks.org/convert-number-to-words/

JuanAntonio's extension linked in post #2 will do the conversion; Patel's Blocks are a start but as you say needs more work to flesh out all the possibilities to 999.

I think that we need to do it number-by-number. For example something like; 34 = 3-4 = thirty-four = thirty four.

I shouldn't provide a full solution because this is homework, but here is a central component ...


I stopped at a billion because I did not have at my fingertips the higher levels past a billion (quadrillion, Brazilian, etc.) and I left out subprocedures that should be clear from their names.Capture

1 Like

You can try yo use :

That's a good app. Can you provide the .aia file?

I added it to the Gallery. Search for agetzler

That is indeed a great app @ABG. I set out to make the shortest app for this, but you beat me to it, with a few blocks less. Also, yours is much more elegant. I have a few remarks though.

The input field could be set to numbers only, then you get a nice numbers-keyboard and the result is always a number.
You ignore fractions in the number.
There is no check for too large numbers.
It is not straightforward to make this into an app in another language.

All true.

If it wasn't a homework project, I would be all over it.

I wonder when the assignment is due?

I added a choice of short scale vs long scale representation, with the extra room generalizing the scale gave me.
quintillion_long_scale sextillion
Here are my conversion tables:
long_scale.txt (179 Bytes) short_scale.txt (148 Bytes)
Different languages are not far off, according to https://www.languagesandnumbers.com/articles/en/long-and-short-numeric-scales/

I didn't do fractional parts yet, leaving it for the next iteration.

I left the keyboard non-numeric, to let me squeeze in commas for sanity checking. (They are ignored in the app.)

Source is in the Gallery, for those who know how to search.

In this link is the extension number to text, indicated in post #2
http://kio4.com/appinventor/258_extensiones_numero_letras.htm

Another way to convert number to text in many languages ​​is to use the Yandex translator.

p258_numero_letras.aia (21.2 KB)

1 Like