Convert Words to a Number
-
Introduction
Sometimes we get a number written as English words, such as “three”, “twenty”, or “one hundred five”. If we want to run any calculation on this number, we have to convert it to an arabic number first.
You can use this reporter block in the Operators category for the conversion:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d4b4779c-0115-4948-86dd-f4587c6cf775.png" width="250" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">
It takes one input, which is the number in word format. The returned value is the number in arabic format.Here are some examples. Note that negative numbers are supported as well.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/722e5a1d-2e71-42d8-ba01-495e9cf8f0d1.png" width="700" style="">
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login