{"title":"System.Power(Decimal, Decimal) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/system/system-power-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-power-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-power-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":"Raises a number to a power.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"System.Power(Decimal, Decimal) Method","slug":"systempowerdecimal-decimal-method","at":0,"chars":3919},{"level":2,"title":"Syntax","slug":"syntax","at":212,"chars":156},{"level":2,"title":"Parameters","slug":"parameters","at":368,"chars":232},{"level":2,"title":"Return Value","slug":"return-value","at":600,"chars":61},{"level":2,"title":"Example 1","slug":"example-1","at":661,"chars":551},{"level":2,"title":"Example 2","slug":"example-2","at":1212,"chars":2573},{"level":2,"title":"Related information","slug":"related-information","at":3785,"chars":134}],"text":"# System.Power(Decimal, Decimal) Method\n> Version: _Available or changed with runtime version 1.0._\nRaises a number to a power. For example, you can use this method to square the number 2 to get the result of 4.\n## Syntax\n```al\nNewNumber :=   System.Power(Number: Decimal, Power: Decimal)\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 you want to raise exponentially. This number is the base in the exponential method.\nPower\nType: ../decimal/decimal-data-type\nThe exponent in the exponential method.\n## Return Value\nNewNumber\nType: ../decimal/decimal-data-type\n## Example 1\n```al\nvar\n    Number1: Decimal;\n    Power1: Decimal;\n    Result1: Decimal;\n    Text000: Label '%1 raised to the power of %2 = %3';\nbegin\n    Number1 := 64;\n    Power1 := 0.5;\n    Result1 := Power(Number1, Power1);\n    Message(Text000, Number1, Power1, Result1);\nend;\n```\nOn a computer that has the regional format set to English \\(United States\\), the first message window displays the following:\n64 raised to the power of 0.5 = 8\nThis example shows that raising a number to the power of 0.5 corresponds to the square root of the number.\n## Example 2\nThis example shows a typical use for the POWER method.\nIf a principal amount P is deposited at interest rate R and compounded annually, then at the end of N years, the accumulated amount \\(A\\) is:\nA = P\\(1 + R\\)N\nFor example, you put LCY 2800 into a bank account that pays 5 percent, which is compounded quarterly. To determine what the amount will be in eight years, you must consider:\nN = 32 payment periods \\(8 years times 4 quarterly periods\\)\nR = 0.0125 per period \\(5 percent divided by 4 quarterly periods\\)\nThe accumulated amount A is:\nA = LCY 2800\\(1 + 0.0125\\)32 =LCY 2800\\(1.4881\\) = LCY 4166.77\nIf a principal amount P is deposited at the end of each year at interest rate R \\(in decimal notation\\) compounded annually, then at the end of N years, the accumulated amount is:\nA = P\\[\\(\\(1 + R\\)N - 1\\)/R\\]\nThis is typically called an annuity.\nFor example, you have an annuity in which a payment of LCY 500 is made at the end of each year. The interest on this annuity is 4 percent, which is compounded annually. To determine what the annuity will be worth in 20 years, you must consider:\nR = 0.04\nN = 20\nThe amount of the annuity A will be:\nA = LCY 500\\[\\(\\(1 + 0.04\\)20 - 1\\)/0.04 = LCY 14,889.04\n```al\nvar\n    P: Decimal;\n    R: Decimal;\n    N: Decimal;\n    A: Decimal;\n    FormatString: Text;\n    Text000: Label 'Principal $%1 at a 5 percent interest rate is compounded quarterly.\\\\';\n    Text001: Label '(Rate = %2)\\\\';\n    Text002: Label 'The amount after %3 years = $%4.';\n    Text003: Label 'Principal $%1 is deposited at the end of each year at a 4 percent interest rate, compounded annually.\\\\';\n    Text004: Label '(Rate = %2)\\\\';\n    Text005: Label 'The amount after %3 years = $%4.';\nbegin\n    FormatString := '<Precision,2><Standard Format,1>';\n    // Example 1\n    P := 2800;\n    R := 0.0125;\n    N := 32;\n    A = P * (Power(1 + R, N));\n    Message(Text000 + Text001 + Text002, P, R, N, Format(A,0,FormatString);\n    // Example 2\n    P = 500;\n    R = 0.04;\n    N = 20;\n    A = P * ((Power(1 + R, N) - 1)/R);\n    Message(Text001, P, R, N, Format(A,0,FormatString));\nend;\n```\nOn a computer that has the regional format set to English \\(United States\\), the first message window displays the following:\nPrincipal $2,800 at a 5 percent interest rate is compounded quarterly.\n\\(Rate = 0.0125\\)\nThe amount after 32 years = $4166.77.\nThe second message window displays the following:\nPrincipal $500 is deposited at the end of each year at a 4 percent interest rate, compounded annually.\n\\(Rate = 0.04\\)\nThe amount after 20 years = $14889.04.\n## Related information\nsystem-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}