Need Help with Python Expression to Calculate Field

252
4
Jump to solution
03-18-2021 10:33 AM
KyleSmiley_nrcs
New Contributor

Hello,

 

I am trying to calculate a field using another field. The code expression is valid and it executes the code but it does not provide the values i'm looking for. Instead, it shows 0's. But I want it to show values of .2 and .33, respectively for the Assigned Percent Loss field that I am trying to calculate.. Any help is greatly appreciated. 

 

KyleSmiley_nrcs_0-1616088760838.png

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

Looks like "Assign_Per_Loss" is LONG or SHORT datatype. It should be FLOAT or DOUBLE.

View solution in original post

0 Kudos
4 Replies
JeffK
by
Occasional Contributor III

What is the field's data type?  It is probably rounding and it should be set to float and the format set to show the correct number format.

BlakeTerhune
MVP Regular Contributor
0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Looks like "Assign_Per_Loss" is LONG or SHORT datatype. It should be FLOAT or DOUBLE.

View solution in original post

0 Kudos
KyleSmiley_nrcs
New Contributor

Code worked and provided the correct output after changing it from long to float. Thanks everybody!

0 Kudos