1

I have a cost field in a table that I do field calculations on. The field contains values like:

  • 1,000
  • 2,100.00
  • 3,500.99
  • 4,900

I would like to use the field calculator to round the values up to the nearest thousand (unless the number is already rounded to the nearest thousand):

  • 1,000.00
  • 3,000.00
  • 4,000.00
  • 5,000.00

How can I do this with python in the field calculator?

2

1 Answer 1

8

You can use this:

-(-!cost!//1000)*1000
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.