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; }, /**