Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

Round

Last wiki revision 2010-03-03

Round a number off to n places. number = round(number, decimals)

  • number: Number. The number to round.
  • decimals : Number. Round to this many places.
  • number : Number. The rounded number.

local number = round(math.pi, 3) print(number) -- prints 3.142

function round(number, decimals) return (("%%.%df"):format(decimals)):format(number) end

  • truncate

Source

https://warcraft.wiki.gg/wiki/Round · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.