AnsweredAssumed Answered

Calculate percentage then round

Question asked by judsoncrouch on Jan 18, 2016
Latest reply on Jan 18, 2016 by judsoncrouch

I am very new to Python but need to write a script to add 20% to a field and then round that number with the 20% to the next 50. I have figured out the calculations but for the life of me can't figure out how to put them together to get it into one function.

 

I've tried this in the code block:

def boom_length(boom):
    twenty_percent = ((!LENGTH_FT!) * 0.2) + !LENGTH_FT!)
    math.ceil(twenty_percent + (50 - twenty_percent) % 50)
    return twenty_percent

 

then in the expression:

boom_length(!BOOM_LEN!)

 

Thanks in advance for the help!

Outcomes