round
Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example `[\"round\", -1.5]` evaluates to -2.
Example usage:
CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setProperties(
circleRadius(round(pi()))
);
Content copied to clipboard
Return
expression
Parameters
expression
number expression to round
See also
<a href="https://maplibre. org/maplibre-style-spec/expressions/#round">Style specification</a>
Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example `[\"round\", -1.5]` evaluates to -2.
Example usage:
CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setProperties(
circleRadius(round(3.14159265359f))
);
Content copied to clipboard
Return
expression
Parameters
number
number to round
See also
<a href="https://maplibre. org/maplibre-style-spec/expressions/#round">Style specification</a>