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 39 6,451
39 REPLIES 39

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?

May I know how to add cents?

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