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?

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Nov 4, 2019 at 17:05
1
  • 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. Commented Nov 4, 2019 at 19:20

1 Answer 1

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(","," ")
PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Nov 5, 2019 at 22:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.