I'm so sorry I haven't written for so long. My work keeps me so busy that I never have one minute for myself. Any way, I'm now here with a new game. It can guess the answer which you have selected by asking some questions.
You can have this game anywhere just by adding the 'guess.js' script. Since it is a jquery based game, so you should also add jquery script in your page. Then, you should call the main method. The following sample shows you how to do it:
In every financial systems we should show the letter version of numbers particularly in prints. It is also very useful for large numbers to understand it. For example if you see this number in digits "900025235" you can't catch how much it is exactly in short view but not in letters "Nine hundred million twenty five thousand two hundred and thirty five".
I think Persian digits letters are one of the most difficult ones in the different languages. Today we are trying to handle this. First take a look here:
1.Usage
Our mission is to change the input hint whenever its value is changed. To register that to your input you should pass these steps:
we should have a map with digit key and the value is the written version of the key. This map is for translation usage(line 13).
2.1 numberToLetter function (line 66)
This is the major function to handle the job. In line 67 we categorize every three digits near together into a category. This is the scales like thousand, million, billion, ... . parts in line 68 is an array of 3 digits. textParts in line 69 is the translated version of parts. renderNumber in line 71 will fill textParts(refer to 2.2). finally the textParts items should be joined together in line 77(refer to 2.4).
2.2 renderNumber function (line 123)
This function renders the letter and fill it to the 'renderRepository' parameter. Then returns a boolean to say if the scale should be rendered or not. If 3 zeros are near to each other the scale should not be rendered. For example 324000122.
2.3 renderTwoLengthNumber function (line 106)
This function should render two digits (num1, num2). There is a lot of exceptions between 10-20 in Persian. So we should handle this in here(lines 107,108). This function also fill the rendered text into the 'renderRepository'.
2.4 concatNumberTexts function (line 85)
This function concats the 'renderRepository' parameter items(textParts variable in numberToLetter function) together and returns full text. In Persian we shouldn't put 'and' after scales. So we should handle it here(lines 91,92).