Python expression in Modelbuilder

885
5
Jump to solution
10-09-2019 12:34 AM
TereziaBecker
New Contributor II

Hi,

I need to sum two fields which are in different layers... 

Using Calculate field and running the expression sum(%Summe_Trassen_eigen%,%Summe_Trassen_angemietet%) 

I get incorrect value.

                            sum(%Summe_Trassen_eigen%,%Summe_Trassen_angemietet%)

The example is: "sum([582,871017020542,2826,20859771853])

the result is: 891876795803 - whats wrong, it has to be 3409,0796...

can you advice whats wrong?

thanks

0 Kudos
1 Solution

Accepted Solutions
NeilAyres
MVP Alum

Changing the decimal symbol is buried quite deeply in the Time & Date setting of Windows.

View solution in original post

5 Replies
NeilAyres
MVP Alum

You appear to have your decimal delimiter (radix) set to a comma ",".

So:

582 +

871017020542 +

2826 +

20859771853

= 891876795803

So change it back to ".", a decimal point.

0 Kudos
TereziaBecker
New Contributor II

Hi @Neil Ayres,

thanks for answer. 

The problem is that I get this values from summstatistic (values are "double"). So it gives me automatic "comma" values. Is there a way how to change double to integer or how to change it to a decimal point?

"Summstatistic" > (the fields are double) > "Get field value" > (double, with comma) - *I do not need the values behind the comma

 

0 Kudos
NeilAyres
MVP Alum

Changing the decimal symbol is buried quite deeply in the Time & Date setting of Windows.

TereziaBecker
New Contributor II

Great thanks a lot!

0 Kudos
NeilAyres
MVP Alum

Sorry, those dialogs are under "Region"