Culture issue: decimal separator

Hi

I have a csv-file containing a column, named Totalhrs, with numbers. The numbers are formatted with a comma as decimal separator, eg. three = 3,00.

I need to sum the values in the column. Therefore I use the formula;

in_dt_data.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(“Totalhrs”).ToString.Trim) ).ToString

However, when eg. the csv-file contains 8 rows, each with value 3,00, I get 2400 as result in stead of 24,00.
The problem is the comma as decimal separator.
So I changed the formula to:

in_dt_data.AsEnumerable.Sum(Function(x) Convert.ToDecimal(x(“Totaal uren (5)”).ToString.Trim.Replace(",“c,”.“c)) ).ToString.Replace(”."c, ","c)

This gives the expected result, but ain’t there a neater way to work with comma delimited decimal numbers?
Is there no way to tell studio/orchestrator which culture settings to use?
Dates are a hell as well :slight_smile:

Any suggestions are much appreciated.
Kind regards

1 Like

Hi refer this link

it may help u

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.