Monday, March 4, 2024

How many digits can a Business Central Amount field actually support?

 by Steve Endow


(If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!)


On Sunday night, as I am prone to do, I was testing something obscure in Business Central Online.

I was checking to see how many digits were supported in a "currency" field, aka an Amount field.  Different numeric fields will have different limitations, but I was specifically interested in the limits of currency amounts.

For instance, if I needed to create a transaction in Venezuelan Bolivars, could Business Central handle a large number of Bolivars?  And could it also handle a large number of Bolivars with "cents"?

500,000 US Dollars is approximately 1.8 trillion Bolivars, give or take


So I entered a really big number in Business Central and saw this error:

Type Decimal

So I learned that the data type is Decimal.  I can never remember the maximum data type values, so I searched for "Business Central decimal data type", which led me to this page:

https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/decimal/decimal-data-type

This page claims "The maximum safe value that will work on all Business Central versions of is +/- 999,999,999,999,999.99".  I'll refer to this value as 15+2--a total of 17 digits.

Note that the article does say "maximum safe value", and doesn't actually indicate the maximum Amount that the Business Central Online application supports.

So I then tried to enter an Amount value of 15+2. And something odd happened.

15+2 is rounded to 15+0

Wait, what?

As soon as I tabbed off the field, it rounded 5.67 to 6.00.  

After testing in a few different Amount fields, it appears that the actual maximum value for a standard Business Central Amount field is a total of 15 digits.  So either 15+0 or 14+1 or 13+2.

I have not yet looked into the code to see what is causing the discrepancy between the theoretical maximum value of the Decimal data type and the practical value of the typical Amount field.

It could be that there is a default max value on Amount fields.  Or it could be some type of data type conversion between the database table field and the UI field.  Not sure yet.

For my particular use case, I suspect that an Amount of 13+2 will be sufficient.  If someone is dealing with 1.8 trillion Venezuelan Bolivars, I'm guessing they won't be looking at the decimals, and will at least round to the nearest thousand.

But this seemed like an obscure oddity, so I thought I would share my Sunday evening learning.


Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central and related technologies.

You can also find him on Twitter and YouTube, or through these links:  links.steveendow.com 





No comments:

Post a Comment

All comments must be reviewed and approved before being published. Your comment will not appear immediately.

How many digits can a Business Central Amount field actually support?

 by Steve Endow (If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!) On Sunday nig...