{"title":"System.Round(Decimal [, Decimal] [, Text]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-round-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-round-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-round-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Rounds the value of a numeric variable.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"System.Round(Decimal [, Decimal] [, Text]) Method","slug":"systemrounddecimal-decimal-text-method","at":0,"chars":3024},{"level":2,"title":"Syntax","slug":"syntax","at":152,"chars":183},{"level":2,"title":"Parameters","slug":"parameters","at":335,"chars":1073},{"level":2,"title":"Return Value","slug":"return-value","at":1408,"chars":61},{"level":2,"title":"Example","slug":"example","at":1469,"chars":1421},{"level":2,"title":"Related information","slug":"related-information","at":2890,"chars":134}],"text":"# System.Round(Decimal [, Decimal] [, Text]) Method\n> Version: _Available or changed with runtime version 1.0._\nRounds the value of a numeric variable.\n## Syntax\n```al\nNewNumber :=   System.Round(Number: Decimal [, Precision: Decimal] [, Direction: Text])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nNumber\nType: ../decimal/decimal-data-type\nThe number that you want to round.\n*[Optional] Precision*\nType: ../decimal/decimal-data-type\nThis optional parameter determines the precision used when rounding. If you do not specify a Precision parameter, then the following steps are used to specify the precision:\n1. The method ReadRounding in Codeunit 45, ReadRounding, is called. ReadRounding returns a decimal value that is the precision. By default, the ReadRounding method returns the Amount Rounding Precision field from the GLSetup table.\n2. If you have customized Codeunit 45 and it does not implement the ReadRounding method, then the precision is specified as 2 digits after the decimal.\n*[Optional] Direction*\nType: ../text/text-data-type\nThis optional parameter specifies how to round the Number parameter. The default rounding method is '='. The following are the options for rounding:\n '=' rounds up or down to the nearest value (default). Values of 5 or greater are rounded up. Values less than 5 are rounded down.\n '\\>' rounds up\n '\\<' rounds down\n## Return Value\nNewNumber\nType: ../decimal/decimal-data-type\n## Example\nThis example shows how to use the Round method.\n```al\nvar\n    DecimalToRound: Decimal;\n    Direction: Text;\n    Precision: Decimal;\n    Result: Decimal;\n    Text00: Label 'Round(%1, %2, %3) returns %4.';\nbegin\n    DecimalToRound := 1234.56789;\n    Direction := '>';\n    Precision := 0.001;\n    Result := Round(DecimalToRound, Precision, Direction);\n    Message(Text000, Format(DecimalToRound,0,1), Precision, Direction, Result);\nend;\n```\nOn a computer that has the regional format set to English \\(United States\\), the message window displays the following:\nRound\\(1234.56789, 0.001, '>'\\) returns 1,234.568\nThe following table displays some additional Round examples.\nNumber|Precision|Direction|Rounded number\n1234.56789|100|=|1200\n1234.56789|10|=|1230\n1234.56789|1|=|1235\n1234.56789|0.1|=|1234.6\n1234.56789|0.001|=|1234.568\n1234.56789|0.001|\\<|1234.567\n1234.56789|0.001|>|1234.568\n-1234.56789|100|=|-1200\n-1234.56789|10|=|-1230\n-1234.56789|1|=|-1234\n-1234.56789|0.1|=|-1234.6\n-1234.56789|0.001|=|-1234.568\n-1234.56789|0.001|\\<|-1234.567\n-1234.56789|0.001|>|-1234.568\nWhen you round down \\('\\<'\\) a negative number, such as -1234.56789, it is rounded down to -1234.567. However, -1234.567 is a mathematically greater value than -1234.56789.\nWhen you round up \\('>'\\) a negative number, such as -1234.56789, it is rounded up to -1234.568. However, -1234.568 is a mathematically smaller value than -1234.56789.\n## Related information\nsystem-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}