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?
-
1Please 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– Vince2019年11月04日 19:20:55 +00:00Commented Nov 4, 2019 at 19:20
1 Answer 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(","," ")
Explore related questions
See similar questions with these tags.