Convert text format

sivagelli

Well-Known Member
Hello @sivagelli,

it's a text data item.Thank you.
Cami :)

If it is a data item, you can only achieve this using Code stage.

Add a code stage with -
  • Input:
    • inNum of text type
  • Output:
    • outNum of text type
  • Code Tab
    • C#:
      outNum = string.Format(System.Globalization.CultureInfo.GetCultureInfo("de"),"{0:0,000.000}",double.Parse(inNum));
The number format changes from US to other countries. Number 1243.45 in US is represented as 1243,45 in Germany, Italy and other countries. Here for conversion, i changed the number format to Germany. CultureInfo.GetCultureInfo("de") is for Germany. Thousands are separated by dot and decimal are with comma. Swedan uses space.

On execution, outNum will have the number of required format.

3456.89 will be converted to 3.456,89.

Post back how it goes!
 
Last edited:

CamiCat

Member
Thank you so much @sivagelli.Worked very well. :) :)
How to convert a text 3456,89 to a number in the format 3456,89?
Thank you so much
 

Jas

New Member
I think I have the same issue as CamiCat.

When trying to convert text "1234,56" to number using ToNumber(), I get 123456. So the result is a hundred times larger than it should be because the decimal separator is missing. Any ideas on how to fix this?
 
Top