tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/7683-getting-of-max-decimal-placesInfinite Kind: Discussion 2023-03-29T21:10:18Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/573185222022-12-28T19:34:35Z2022-12-28T19:34:35ZGetting of max. decimal places<div><p>It’s not on the account. Once you have a security sub account then you get the account’s currency (which is the security master) and the method is on there is .getDecimalPlaces()</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/573185222022-12-28T19:40:21Z2022-12-28T19:40:21ZGetting of max. decimal places<div><p>So something like:</p>
<pre>
<code>from com.infinitekind.moneydance.model import Account, CurrencyType
if secAcct.getAccountType() == Account.AccountType.SECURITY:
security = secAcct.getCurrencyType()
dpc = security.getDecimalPlaces()
print secAcct, security, dpc
else:
raise Exception("Must be on a Security sub-account to do this! :->")</code>
</pre></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/573185222022-12-28T19:46:05Z2022-12-28T19:46:09ZGetting of max. decimal places<div><p>it works, thanks a lot</p></div>Michal Ĺ ebestatag:infinitekind.tenderapp.com,2009-01-14:Comment/573185222022-12-28T19:52:11Z2022-12-28T19:52:11ZGetting of max. decimal places<div><p>👍 Anytime, just post any questions....</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/573185222022-12-28T21:09:33Z2022-12-28T21:09:33ZGetting of max. decimal places<div><p>PS. The getDecimalPlaces() method should be rarely needed as the inbuilt CurrencyType methods of the Security will correctly decode / convert any security’s qty stored on an Account from a decimal long (int) value into a double (float). Eg .formatFancy(), .formatSemiFancy(), .getDoubleValue().</p></div>Stuart Beesley (Mr Toolbox)