Convert Number to Text Format

Can anyone suggest how I can convert Number to Text in workflow. I want to print Invoice and want Total Amount to be printed as Text in the Output Invoice.

0 38 6,322
38 REPLIES 38

How about this expression?
TEXT([Total Amount])

@Fabian I think my question was not clear. I want if there is โ€œ[Total Amount]=1000โ€ then i want this to be converted to โ€œOne Thousandโ€ in word format. Can u suggest a solution for this. .

There is no built-in solution to meet your goal, and writing an expression to handle arbitrary values would be extremely complicated.

@tsg_despatch
Something like this?
Youโ€™re free to take a copy of this app from my portfolio:
Portfolio URL: https://www.appsheet.com/portfolio/245151
App Name: Number2Text

Neat!!!

Thanks @Steve, appreciated.

Wow! Really very creative implementation @LeventK !

Cools Thanks @LeventK

Genius!
TeลŸekkรผrler elinize saฤŸlฤฑk

I try using this but give wrong text if number below 100

@Jkr_Ckmnt
Thanks bringing it to my attention. The glitch is now fixed.

@LeventK, t is a work of genius! Thank you

Thnx @Guy_Merlin_Dyangnou, my pleasure.

Impressive!!

What about until 1 billion?

Thank you very much Mr. LeventK.

I tried and tried to make it in Million (not only thousands), however always fail. Can you help me please?

@Bpinontoan
I have updated the app to textify numbers up to 999,999,999. Provided you have copied my app, please delete that app and copy the new one to see and adopt the changes.

Wowโ€ฆ
Where and how can i get Or copy of the apps?

Thank you very much


TRANSLATION FEATURE ADDED


Also added the translation feature via Google Translate API in compliance with ISO-639-1 Code which supports 109 languages via NMT/PBMT model.

Whoa! Nice!


STANDALONE WEBHOOK


A couple of members had texted me that, they have copied the app but translation feature is not working Thatโ€™s so normal, because the app is using a standalone webhook workflow. To make it working for you; there are a couple of steps that you shall follow:

1. You need to subscribe to Google Cloud
2. You need to activate Google Translate API and generate an API Key (check it here)
3. Create a Google Apps Script (you can copy the code below), make necessary changes as per your requirements and deploy the script as a WebApp. When deploying, you shall ensure that the webapp is deployed for use of Anyone, even anonymous. Take a note of the generated webapp URL, as you will need it for your AppSheet Webhook Workflow


THE CODE


var SHEETID = "Your Sheet ID here";
var SHEETNAME = "Your Sheet Name here where you want the translation to be recorded";
var TR_COL_INDEX = 7; // The column index (A=1) in your sheet for the translation record
var API_KEY = "Your API Key here";
Logger = BetterLog.useSpreadsheet(SHEETID);

function doPost(e) {
  Logger.log("Number2Text Webhook triggered...");
  var payload = JSON.parse(e.postData.contents);
  var string = payload.InWords;
  var target = payload.TargetL;
  var rowNr = parseInt(payload.RowNr);
  try {
    var baseURL = "https://translation.googleapis.com/language/translate/v2?key=API_KEY";
  
    var payload = {
      "q" : string,
      "source" : "en",
      "target" : target,
      "format" : "text"
    }
    
    var headers = {
      'content-type': 'application/json'
    }
    
    var options = {
      "method" : "post",
      "payload" : JSON.stringify(payload),
      "headers" : headers
    };
    
    var response = JSON.parse(UrlFetchApp.fetch(baseURL, options));
    var trText = response.data.translations[0].translatedText;
    SpreadsheetApp.openById(SHEETID).getSheetByName(SHEETNAME).getRange(rowNr, TR_COL_INDEX).setValue(trText);
    
    Logger.log("Source Language: en"+"\nTarger Language: "+target+"\nString: "+string+"\nTranslation: "+trText);
    
    return ContentService    // return json success results
    .createTextOutput(
      JSON.stringify({"result":"success",
                      "data": JSON.stringify(payload) }))
    .setMimeType(ContentService.MimeType.JSON);
  } catch (e) {
    MailApp.sendEmail("youremail@domain.com", "Webhook Error Occured!", 
                      "\r\nMessage: " + e.message
                      + "\r\nFile: " + e.fileName
                      + "\r\nLine: " + e.lineNumber);
    e = (typeof e === 'string') ? new Error(e) : e;
    Logger.severe('%s: %s (line %s, file "%s"). Stack: "%s" . While processing %s.',e.name||'', 
                  e.message||'', e.lineNumber||'', e.fileName||'', e.stack||'', processingMessage||'');
    throw e;
  }
}

APPSHEET WEBHOOK WORKFLOW


Hi mr. LeventK โ€ฆ awesome your helps.
I am still waiting How to convert number to Text format in million (not just thousands).

From your appsโ€ฆ i tried and tried to modify but always failโ€ฆ
Could you help me?

Thank you and very appreciate,

Have you copied the latest app build? As I have updated the app to cover the number range up-to 999,999,999

I am sorryโ€ฆ Copy from Where?

Finallyโ€ฆ i got already.

Thank you and thank you very much Mr. LeventK.

Awesome!

@Bpinontoan
Youโ€™re very welcome, my pleasure. Glad to hear that you figured it out.

I created a number-to-letter table list and used the lookup for reference. This method has many limitations but I am using it very simply and effectively for newbies.

Tiแปn ฤแปc sแป‘
1000 Mแป™t nghรฌn ฤ‘แป“ng
2000 Hai nghรฌn ฤ‘แป“ng
3000 Ba nghรฌn ฤ‘แป“ng
4000 Bแป‘n nghรฌn ฤ‘แป“ng
5000 Nฤƒm nghรฌn ฤ‘แป“ng
6000 Sรกu nghรฌn ฤ‘แป“ng
7000 Bแบฃy nghรฌn ฤ‘แป“ng
8000 Tรกm nghรฌn ฤ‘แป“ng
9000 Chรญn nghรฌn ฤ‘แป“ng
10000 Mฦฐแปi nghรฌn ฤ‘แป“ng
11000 Mฦฐแปi mแป™t nghรฌn ฤ‘แป“ng
12000 Mฦฐแปi hai nghรฌn ฤ‘แป“ng
13000 Mฦฐแปi ba nghรฌn ฤ‘แป“ng
14000 Mฦฐแปi bแป‘n nghรฌn ฤ‘แป“ng
15000 Mฦฐแปi nฤƒm nghรฌn ฤ‘แป“ng
16000 Mฦฐแปi sรกu nghรฌn ฤ‘แป“ng
17000 Mฦฐแปi bแบฃy nghรฌn ฤ‘แป“ng
18000 Mฦฐแปi tรกm nghรฌn ฤ‘แป“ng
19000 Mฦฐแปi chรญn nghรฌn ฤ‘แป“ng
20000 Hai mฦฐฦกi nghรฌn ฤ‘แป“ng

โ€ฆ

Ostras, que interesante!!! q idioma es?

@LeventK

this is Greate solution, sir,

I am trying to do some change to the Indian amount methods

where
one hundred thousand = 1 lakhs
millions become 10 lakhs
10 million become 1 crore.
100 million = 10 crore

working on it if possible then please provide some hints because expressions are very impressiove and longs. and i want to stop this ate 10 crores.

I have the exact requirement but don't have it implemented yet in AppSheet.

I am using a workaround as follows. Assume we need to get words in Indian Rupees for the column [Total].

1. Create an Action as follows to open a URL. Use the following formula:

CONCATENATE("https://num2word.com/?number=",[Total])

Example: https://num2word.com/?number=15177.20

Kunal_Jain_0-1662786469762.png

2. Clicking this action will take you to a website and you'll have to copy the result into the desired field manually.

This is a semi-automation.

Hello guys!
A colleague recently asked me for this tool to transform prices into text in Portuguese (Brazil). Some grammar rules are different here besides the question of prices and not numbers.

I created an application that Iโ€™m still testing but that apparently manages to correctly translate to PT-BR the price values โ€‹โ€‹entered with the name of the local currency (Reais / Centavos).

Iโ€™ll make it available here because I only found this forum through this colleague, so if any Brazilian looking for the same function will already be available here.

It translates numbers below 1 Billion and as it is a complex system to make the formulas were robust, but basically the app works as follows:

1- There are 2 tables, one with the names already recorded and a record of its positioning, another table where you enter the number you want to translate;

2- There is 1 virtual column to identify the size of this number and so we can separate it into Millions, thousands, hundreds and cents;

3- For each box there is 1 column that identifies the value and translates it including its end (million, million, thousand, reais, cents), each formula has between 118 and 61 lines;

4- Our last virtual column completes these values โ€‹โ€‹in the correct order.


Olรก pessoal!
Recentemente um colega me solicitou essa ferramenta para transformar preรงos em texto em Portuguรชs (Brasil). Algumas regras gramaticais sรฃo diferentes por aqui alรฉm da questรฃo de ser preรงos e nรฃo nรบmeros.

Criei um aplicativo que ainda estou testando mas que aparentemente consegue traduzir corretamente para PT-BR os valores de preรงo inseridos junto ao nome da moeda local (Reais / Centavos).

Vou disponibilizรก-lo aqui pois sรณ encontrei esse fรณrum atravรฉz desse colega, entรฃo caso algum Brasileiro procure pela mesma funรงรฃo jรก estarรก aqui disponรญvel.

Ele traduz nรบmeros abaixo de 1 Bilhรฃo e como รฉ um sistema complexo de se fazer as fรณrmulas ficaram robustas, mas basicamente o app funciona da seguinte maneira:

1- Existem 2 tabelas, uma com os nomes jรก gravados e um registro do posicionamento dele, outra tabela onde vocรช insere o nรบmero que deseja traduzir;

2- Existe1 coluna virtual para identificar o tamanho desse nรบmero e assim podemos separรก-lo em Milhรฃo, milhar, centenas e centavos;

3- Para cada casa existe 1 coluna que identifica o valor e o traduz incluindo seu final (milhรฃo, milhรตes, mil, reais, centavos), cada fรณrmula possui entre 118 e 61 linhas;

4- Nossa รบltima coluna virtual completa na ordem correta esses valores.

APP URL Preรงo por extenso - AppSheet



olรก amigo, agradeรงo por ter compartilhado seu aplicativo, esta sendo muito รบtil, reparei que รก um pequeno erro de concatenar entre os nรบmeros de um milhรฃo e 9 milhรตes, onde ele esta interpretando como dezena de milhรตes e retornando errado, por exemplo 1100100,10 = e Milhรตes e 100 mil reais e dez centavos" chegou a verificar esse erro? poderia me auxiliar em como resolve-lo? obrigado

Obrigado pelo feedback, realmente hรก alguns casos onde isso acontece e nรฃo havia previsto. Verifiquei muitas variaรงรตes mas essa escapou, vou tentar revisar em breve assim que tiver um tempo mas vou deixar aqui caso queira olhar e tambรฉm de anotaรงรฃo:

O erro estรก na coluna Milhao entre as linhas 75 e 7103;
O correto รฉ que a fรณrmula verifique da direita para a esquerda o tamanho do nรบmero e coloque โ€˜โ€˜milhรฃoโ€™โ€™ ou โ€˜โ€˜milhรตesโ€™โ€™ de acordo com o tamanho:
xxx.yyy.zzz,aa
x= milhรฃo
y= milhar
z= centenas
a= centavos

Aparentemente o uso da vรญrgula interfere no resultado mas nรฃo consegui identificar como

SOLVED!

Congrats, can you explain how? Thanks @mattlops 

Hi Sara! 
Actually the problem is exactly was I told in the another comment. I figured out I miss a number on the formula passing the correct number by 1. After find the incorrect number I just change and the formula just worked fine.

The correct formulas is in the app

APP URL Preรงo por extenso - AppSheet

Matheus,

Primeiramente, obrigado pela contribuiรงรฃo. Porรฉm copiei o seu app no link acima e ainda apresenta problema.

Inicialmente aparece o valor correto por extenso, mas apรณs sincronizar o registro aparece "milhรตes" o invรฉs de "1 milhรฃo". A mesma coisa acontece com "5.000" que aparece "E cinco mil".

Agradeรงo se puder revisar e descobrir o que estรก quebrando as fรณrmulas, pois estou tendo dificuldade em fazรช-lo.

1.png

 

2.png

 

Top Labels in this Space