函数TwoPlacesAtLeast(x){ return((x +''')。length == 1) ?''& nbsp;''+ x:''''+ x } sp1 =''< span style =" font-family:courier;">'' sp2 =''< / span>< br>'' document.write (sp1 + TwoPlacesAtLeast(1)+ sp2); document.write(sp1 + TwoPlacesAtLeast(12)+ sp2); document.write(sp1 + TwoPlacesAtLeast(3) )+ sp2); document.write(sp1 + TwoPlacesAtLeast(99)+ sp2); - Evertjan 。 荷兰。 (用我的电子邮件地址替换所有带点的十字架) function TwoPlacesAtLeast(x){return ((x+'''').length==1)?'' ''+x:''''+x} sp1 = ''<span style="font-family:courier;">''sp2 = ''</span><br>'' document.write(sp1+TwoPlacesAtLeast(1)+sp2);document.write(sp1+TwoPlacesAtLeast(12)+sp2);document.write(sp1+TwoPlacesAtLeast(3)+sp2);document.write(sp1+TwoPlacesAtLeast(99)+sp2); --Evertjan.The Netherlands.(Replace all crosses with dots in my emailaddress) 这篇关于在对齐的列中显示数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-30 06:19