How can I label points to have decimal number of depth lower than main number?
Remove the second line in your script: "Findlabel = Function ......."
That line was not in my script :-)
I didn't get your objective clearly.
" label points to have decimal number of depth lower than main number"?
Could you explain in more detail?
Thank for your requesting. I mean, what can I do to display depths on map like this:
if I have data in table: 17.8 ?
Take my codes as an example.
I have a point layer, viz., "pointPB".
I have a field namely lat containing the floating datatype (as per your example field).
I have added 03 new fields, viz. lat_test, lat_b4, and lat_aft (All Text datatype)
I used field calculator in lat_test to import the values of lat field as text.
Then I used python script in ArcPy to divide the values of lat_test and insert them into lat_b4 and lat_aft.
Feat = 'pointPB'
FieldArr = ['lat_test','lat_b4','lat_aft']
with arcpy.da.UpdateCursor (Feat , FieldArr ,'*') as cursor:
... for row in cursor:
... ind = row.index('.')
... row = row[:ind]
... row = row[ind+1:]
Then I went to layer properties > Labels tab. Then I clicked Expression button.
I wrote the following tag in Expression
[lat_b4] & "<SUB>" & [lat_aft] & "</SUB>"
That did the job.
Hope I could help.
Give it a try if you could spare some time
Use this VBscript in your labelfield expression :
Function FindLabel ( [HEIGTH] )dim ss = ([HEIGTH] )if instr (s,".") = 0 then findlabel =selse Loc_Left = InStrRev(s,".") -1 Left_string = Left(s, Loc_Left) Loc_Right = InStrRev(s,".") + 1Right_string = Left(s, Loc_Right)
findlabel =Left_string & " " & "<SUB>" & Loc_Right & "</SUB>"
end ifEnd Function
Thank you very much for answer. Window pops up, that in line 14 is an error.
Three things to pay attention to:
1. Choose VBscript for parser
2. Enable the Advanced button
3 Replace [HEIGTH] with your own used fieldname.
I have done this, but it still does not work.
Yes, It works Thank you very much for your help
Retrieving data ...