Writing numbers
1990/09/01 Arrojeria, Eustakio - Elhuyar Zientziaren Komunikazioa | Lizaso, Pili - Informatika SailaElhuyar Fundazioa Iturria: Elhuyar aldizkaria
From this moment on, most people will have the holidays at the end, leaving aside, at least in part, games and entertainment, and we will start again.
The purpose of the program that we offer you in this issue is to work the writing of the numbers. It is relatively simple in terms of use, but this does not mean that it is not useful. We consider it interesting for children who are studying numbers and for those who are learning Basque.
The program gives the number in letter and you have to write the number. However, once practiced a little, the user can complete more things if desired. To do this, it is enough to make a small change in the program, so that it, instead of giving the written number, give the figure leaving it to be written in letter for the user.
As always, we leave these little changes in your hands. We attach a brief explanation of the main programs and parts.
![](images/A39023.jpg)
Description of the program:
Four main tables are used in this program:
OAL: It is used to save the digits of the randomly created number.
![](images/A39023-a.jpg)
The tables TAU1$, TAU2$ and TAU3$ are used to complete the representation in letter of the number. The digits that make up the number as an index will be used to access the elements of the following tables
...The most important part of this program is the subroutine NUMBER, which will be the one we will analyze most closely.
It uses as parameter X and Y (of the integer digit to which you should treat) and returns ZE$.
This subroutine deals with the number of three digits; the main program will take care of the millions, thousands, etc. Check that they are.
X and Y will be equal (in the case of a single digit number) or X Y. In the first case it is enough to take as index the digit located in the position X and take the value of the table TAU1$.
![](images/A39023-b.jpg)
In the second case, the digits will be analyzed individually:
- If the percentage digit exists, the corresponding element of TAU3$ will be taken.
- If there are ten digits:
- If it is 0 or 1, you must also take into account the digit of the units and consult with both the table TAU1$.
- If it is equal to or greater than 2, consult the TAU2$. To calculate the index you have to do the digit / 2, since in Basque the numbering system is twenty.
- When analyzing the digit of the units, it must be taken with that of the tenth and calculate the rest that is obtained by dividing by 20.
To establish the relationships between the words corresponding to each digit, the following criteria is followed:
- Between percentages and decimals (if there are both), “ and “
- Between tens and units (if the first is 2 or higher and the two exist), “ta”
- When adding the corresponding part to the units, once the residue is calculated:
- If it is 10 add whole
- If it is from 10 to 18, avoiding adding (ha) of letter 3 to the end.
- If it is 19 eat the last “a” and add “nineteen”.
NOTE
When capturing the tables TAU1$ and TAU3$, the value of the indices is 1 higher than the digit or number. The reason is that the first element of these tables is empty (for the case of 0).
![](images/A39023-c.jpg)
![](https://elia.eus/static/elhuyar/img/elia_RGB.png)
Gai honi buruzko eduki gehiago
Elhuyarrek garatutako teknologia