Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am pulling variable value by using Get Expression Value, and then Storing that in a variable. Its all working fine, but I'm unable to format the number with ',' separator.
current numbers being displayed as: 5487398
How i want it to display : 54,87,398
I tried to look for the solution could not find any. Please help.
Hello,
I do not think that there is an out of box formula for this in QAA, but i might be wrong.
What you can do is set up a "Custom Code" block, set it to node as the preferred language and add the following code as input:
let number = 5487398;
// US system en-US
let usFormatNumber = number.toLocaleString('en-US');
console.log(usFormatNumber ); // 5,487,398
This will parse the number to a local string based on a locale parameter.
The position of the comma can be changed by different locales like the 'en-US' separates numbers with a comma at every 3 digits while 'hi-IN' uses a comma at every 2 digits (the last 3 digits are not separated).
Hello,
I do not think that there is an out of box formula for this in QAA, but i might be wrong.
What you can do is set up a "Custom Code" block, set it to node as the preferred language and add the following code as input:
let number = 5487398;
// US system en-US
let usFormatNumber = number.toLocaleString('en-US');
console.log(usFormatNumber ); // 5,487,398
This will parse the number to a local string based on a locale parameter.
The position of the comma can be changed by different locales like the 'en-US' separates numbers with a comma at every 3 digits while 'hi-IN' uses a comma at every 2 digits (the last 3 digits are not separated).
Thank you @Shai_E I will try this out and let you know the results.
@Shai_E I have tried your method it worked. Thank you so much. Below is how I am storing the variable value from Qlik Sense app, then using custom code to format numbers, then using the store variable value to send it over slack. Thanks again.