請不要因爲詢問一個「啞巴」問題而抱怨我,但我一直在爲此奮鬥了幾個星期!在javascript中轉換數字數組toString()
爲什麼這個數組離開我的前導零並將numbers轉換爲不同的格式,即使在我使用toString()將值轉換爲字符串後?
var coords=new Array();
coords[0]=new Array(03336890,"SPOON RIVER NEAR ST. JOSEPH, IL");
coords[1]=new Array(03346500,"EMBARRAS RIVER AT LAWRENCEVILLE, IL");
coords[2]=new Array(03612600,"OHIO RIVER AT OLMSTED");
coords[3]=new Array(05543010,"ILLINOIS RIVER AT SENECA, IL");
coords[4]=new Array(05554300,"INDIAN CREEK NEAR FAIRBURY, IL");
coords[5]=new Array(05576100,"LICK CREEK NEAR WOODSIDE, IL");
coords[6]=new Array(05576195,"SUGAR CREEK NEAR CHATHAM, IL");
coords[7]=new Array(05586300,"ILLINOIS RIVER AT FLORENCE, IL");
coords[8]=new Array(05599490,"BIG MUDDY RIVER AT RTE 127 AT MURPHYSBORO, IL");
coords[9]=new Array(411955088280601,"HANSON GRAVEL PIT AT CULVERT NEAR MORRIS, IL");
for (i=0;i<coords.length;i++){
coords[i][0].toString();
}
檢查出來的結果上jsfiddle
這是那麼容易,很難!感謝您指出明顯!我真的需要它! – daniella
我一定會在兩分鐘內接受 – daniella
讚賞。謝謝。 – CodeWizard