Issue querying parcel data for display in an infoWindow

607
1
Jump to solution
03-04-2013 01:30 PM
AlexGilvarry
New Contributor II
I'm attempting to query a parcel layer and display the information in a popup infoWindow when I click on a parcel, and I'm having some issues dealing with different datatypes.

var content = "<b>Address</b>: ${ADDR}" + "<br /><b>Owner Name</b>: ${OWNER}" + "<br /><b>Parcel ID</b>: ${APN}" + "<br /><b>City</b>: ${CITY}" + "<br /><b>Acres</b>: ${TOTAL_ACRES:NumberFormat}" + " <br /><a href='${COUNTY_LINK}'>County Assessor Site</a>"    var popUpTemplate = new esri.InfoTemplate("Parcel", content);


The ADDR, OWNER, APN, COUNTY_LINK and CITY datatypes are all string so they appear in the infoWindow without issue, but I'm having trouble getting TOTAL_ACRES to appear.

TOTAL_ACRES is a double, and i thought that using the dojo.number.format method as outlined in the documention would help, but it doesn't seem to do anything.

I've included some screetshots of the data in arcmap, in case that can be of any help:
[ATTACH=CONFIG]22357[/ATTACH]
[ATTACH=CONFIG]22358[/ATTACH]

Any help would be greatly appreciated!
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: evtguy

My (successful) use of dojo.number.format is something like this:

dojo.number.format(spanishPct, {places:2})


Another option might be using javascript's toFixed() method on the variable containing your acres value:

 alert('Size in acres: ' + theAcres.toFixed(2)); //format number to only 2 decimal places

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable
Original User: evtguy

My (successful) use of dojo.number.format is something like this:

dojo.number.format(spanishPct, {places:2})


Another option might be using javascript's toFixed() method on the variable containing your acres value:

 alert('Size in acres: ' + theAcres.toFixed(2)); //format number to only 2 decimal places
0 Kudos