MODEL BUILDER

241
3
12-12-2017 11:17 AM
ArmandoFreites
New Contributor III

In a model constructor. what tools should I use so that the data of a specific field come out with two decimal points

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

There are no tools in arctoolbox that do that specific task.

You would need to format your output in whatever mechanism you are using to produce output.

within text files you could round, truncate and a variety other things.

a = 1.23456789 .... python's   round(a, 2)  1.23  etc

So the important question is where do you want two decimals being shown... in the input? the output? and in either case what are they?

ArmandoFreites
New Contributor III

Hellooooo, excelent.

But I have a one last problem with this, when the number is  1,101547, for example,    the outptu is 1,1, but I need: 1,10

How do I solve this?
0 Kudos
DanPatterson_Retired
MVP Emeritus

again within text... getting the trailing zero on floats can be futile

a = 1.1011
"{:.2f}".format(a)
 '1.10'
0 Kudos