Skip to main content
Nintex Community Menu Bar
Solved

Format number to string with no commas or decimals

  • November 4, 2022
  • 2 replies
  • 1443 views

Forum|alt.badge.img+4

Hello. I want to convert 4 or more digit numbers to strings that don't have any punctuation. 

 

For example, when I format the number 4444 to a string and choose "Number" as the format. The resulting string is "4,444.0". I want the result to be "4444".

 

How can I achieve that? Thank you.

 

 

Best answer by WouterT

Here is a two-step solution hopefully:

1. Convert the numeric value into an integer

2. Create a text string with the integer in it.

 

Here is the little test:

One start variable: a numeric input with the value 4321.56

followed by:

I added the '<' and the '>' just for clarity in the output here.

Gives the result :

2 replies

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Answer
  • November 5, 2022

Here is a two-step solution hopefully:

1. Convert the numeric value into an integer

2. Create a text string with the integer in it.

 

Here is the little test:

One start variable: a numeric input with the value 4321.56

followed by:

I added the '<' and the '>' just for clarity in the output here.

Gives the result :


Forum|alt.badge.img+4
  • Author
  • Scholar
  • November 7, 2022

Thank you, @WouterT 

The 2 step process worked. 

 

It didn't occur to me to use the operation "Create a text string". I was originally using the action "Format number to string" and it added the comma thousands separator as well as the ".0" at the end.

 

I also tried skipping the "Convert a value" step, which converts the number to an integer. And that produced a string without the thousands separator, but the ".0" was still displayed.

 

So, the 2 step process is the winner. Thank you!