From 19359537960593ab05f932b54e4b7790eed2b4c4 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 4 Oct 2006 20:57:25 +0000 Subject: [PATCH] minor update to r1558 for coding standards, comments, etc git-svn-id: http://svn.openlayers.org/trunk/openlayers@1572 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/BaseTypes.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/OpenLayers/BaseTypes.js b/lib/OpenLayers/BaseTypes.js index 64c58ec2e3..369018738d 100644 --- a/lib/OpenLayers/BaseTypes.js +++ b/lib/OpenLayers/BaseTypes.js @@ -360,21 +360,24 @@ OpenLayers.Bounds.prototype = { }, /** - * @return Simple String representation of OpenLayers.Bounds object. - * (ex. "5,42,10,45") - * @type String - */ - toBBOX:function(power) { - var mult; - if (power != null) { - mult = Math.pow(10,power); - } else { - mult = Math.pow(10,6); - } - return (Math.round(this.left*mult)/mult + "," + - Math.round(this.bottom*mult)/mult + "," + - Math.round(this.right*mult)/mult + "," + - Math.round(this.top*mult)/mult); + * @param {int} decimal How many significant digits in the bbox coords? + * Default is 6 + * + * @returns Simple String representation of OpenLayers.Bounds object. + * (ex. "5,42,10,45") + * @type String + */ + toBBOX:function(decimal) { + if (decimal== null) { + decimal = 6; + } + var mult = Math.pow(10, decimal); + var bbox = Math.round(this.left*mult)/mult + "," + + Math.round(this.bottom*mult)/mult + "," + + Math.round(this.right*mult)/mult + "," + + Math.round(this.top*mult)/mult; + + return bbox; }, /**