0

I am using ArcGIS Desktop 10.6.

I have a integer field [no_lot] which contains values in the following format: '3 546 777' I need to transfer the data into a text field for joining purposes.

I created a text field named [lot_text]. I ran the field calculator for the field [lot_text] with the following expression:

[lot_text]=[no_lot]

which returned values in this format '3546777', so the space thousand separators have been removed.

How can I calculate the field while keeping the thousand separators using Python or else?

  • 1
    Please Edit the question show what you have created, function-wise, and describe the actual output, and how that does not meet your need. You should probably first have Python code which processes numeric strings of various lengths, to make sure you have a handle on the Python needed before you tangle with Field Calculator syntax quirks. – Vince Nov 4 '19 at 19:20
1

As stated in the comments. There are two potential ways to preserve the thousands separator using the field calculator:

Using the Python Parser in the Field calculator:

format(!no_lot!, ",").replace(","," ")

or as per @PolyGeo's suggestion:

"{:,}".format(!no_lot!).replace(","," ")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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