Double To String in specific format

Hi,

  1. Assign Activity: Start by storing your double value in a variable. Let’s say the variable name is doubleValue and it contains the value 1238.2.
  2. Assign Activity: Convert the doubleValue to the desired format using the ToString method with a specific format string.

formattedString = doubleValue.ToString(“N2”, new CultureInfo(“fr-FR”)) + " (€)"

N2: This specifies that the number should be formatted with a thousands separator and two decimal places.

CultureInfo(“fr-FR”): This uses the French culture settings which format numbers with a comma as the decimal separator and a dot as the thousands separator. This will result in “1.238,20”

1 Like