[OpenLayers-Users] limit decimal numbers

Alessio Di Lorenzo alessio.dilorenzo at gmail.com
Mon Sep 15 06:30:04 EDT 2008


Jon, thank you very much!
That's exactly what I need!

:)


Jon Blower wrote:
> 
> Hi Alessio,
> 
> JavaScript 1.5+ has a toFixed() method to format numbers to a certain
> number of decimal places and a corresponding toPrecision() method to
> format using a certain number of significant figures.
> 
> http://www.pageresource.com/jscript/j_a_03.htm
> 
> Cheers, Jon
> 
> 
> ---------- Forwarded message ----------
> From: Alessio Di Lorenzo <alessio.dilorenzo at gmail.com>
> To: users at openlayers.org
> Date: Mon, 15 Sep 2008 02:10:19 -0700 (PDT)
> Subject: [OpenLayers-Users] limit decimal numbers
> 
> Hi list,
> 
> I created a function returning the current map extent and updating values
> every time the user pan or zoom the map.
> 
> The function works fine and the effect is what I was looking for, but now
> I
> need to control how many decimal numbers appear after the comma separator.
> For example I want to display always 5 decimal numbers after the comma...
> There's a way to do such thing?
> 
> Thanks, alessio
> 
> -- 
> Dr Jon Blower
> Technical Director, Reading e-Science Centre
> Environmental Systems Science Centre
> University of Reading
> Harry Pitt Building, 3 Earley Gate
> Reading RG6 6AL. UK
> Tel: +44 (0)118 378 5213
> Fax: +44 (0)118 378 6413
> j.d.blower at reading.ac.uk
> http://www.nerc-essc.ac.uk/People/Staff/Blower_J.htm
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/limit-decimal-numbers-tp19489465p19490470.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list