i have use case where i have to add , to make number as thousand.
Eg. 40000.00 should be 40,000.00
3000 should be 3,000
like this
Lenght of the interger is not fixed
i have use case where i have to add , to make number as thousand.
Eg. 40000.00 should be 40,000.00
3000 should be 3,000
like this
Lenght of the interger is not fixed
numbers need to be formatted with commas
e,g 39276.4 to be as 39,276.4
4000 to be 4,000
length of the number is not fixed… “,” should be in thousand format
Hi @sshitol
If(inputNumber Mod 1 = 0, String.Format(“{0:N0}”, inputNumber), String.Format(“{0:N2}”, inputNumber))
Try this.
To handle your use case in UiPath, where numbers of varying lengths need to be formatted with a thousand separator while preserving decimal points, you can use the following approach:
Use a Numeric Variable:
Ensure the input number is of type Double or Decimal to handle both integers and floating-point values.
Format the Number with Thousands Separator:
Use the .ToString method with the #,##0.00 format specifier. This format ensures:
40000.00 → 40,000.00).UiPath Workflow Example:
inputNumber (type: Double or Decimal).formattedNumber (type: String).formattedNumber = inputNumber.ToString("#,##0.00")
Examples of Outputs:
40000.00 → Output: 40,000.003000 → Output: 3,000.001234567.89 → Output: 1,234,567.89inputNumber).Assign activity:formattedNumber = inputNumber.ToString("#,##0.00")
formattedNumber using a Message Box or write it to a file.Would you like me to create a visual guide or a sample workflow file for you?