# Are there any standards for the precision of stocks prices, amount of stocks etc.?

I am currently developing a software that needs to store stock prices and the amount of stocks (sold/purchased) of a given company. Now I am wondering which data types I need to use to store this data. The issue I have with that is that I don't know which numbers (how many decimals) can occur:

1. Is there any standard on the precision of stock prices, e.g. how many decimals can there be?
2. I know that there can be fractional shares due to stock splits, dividend reinvestments or just because your broker allows it. Same here: How many decimals can there be at maximum?

Is there any "broker / banking industry" standard on this?

• Is this for accounting? That’s the only use where this matters. Otherwise use float and be done with this – Aksakal almost surely binary Jan 16 at 17:22
• @Aksakalalmostsurelybinary A nitpick, but float is not a good choice for non-integer values that must have an exact decimal representation. You can't, for examlpe, represent 1.3 exactly with a floating-point variable. A "decimal" type is better suited for monetary values and exact decimal fractions. – D Stanley Jan 16 at 22:59
• @DStanley, true, but I'm saying the exactness is only needed for accounting. – Aksakal almost surely binary Jan 16 at 23:01
• I’m voting to close this question because as Aksakal said, this seems a question in brokerage firm accounting practices, rather than Quant Finance. It should be addressed to an accountant, and the answer will probably depend on details of your business and operations. – noob2 Jan 17 at 17:23

In 2005, the Securities and Exchange Commission introduced Rule 612, also known as the Sub-Penny Rule. Rule 612 requires the minimum price increments for stocks over \$1.00 to be \$0.01 while stocks under \$1.00 can be quoted in increments of \$0.0001.
Fractional share quantities can be entered out to 3 decimal places (.001 as long as the value of the order is at least $0.01). But Robinhood and Interactive brokers allow the purchase of fractional shares as small as 0.000001 and 0.0001, respectively, as long as you satisfy the minimum purchase amount. I don't know if this helps. • thank you, while your 2 cents might not be a final reply (maybe there isn't one at all), the Robinhood sample is quite interesting for me: this won't fit the SQL Server MONEY datatype (4 decimals precisions, not rounding errors etc.) as Interactive Brokers still would have done ): So your answer is already helpful (besides that I am lost now, what's the best way to store such small fractions) – stefan.at.wpf Jan 16 at 15:13 • Asking out of curiosity. I have no experience with SQL, but why not change the datatype to allow for more decimals? Why not change the datatype to DECIMAL(19,6), thus allowing for 6 decimals after the decimal place? – Pleb Jan 16 at 15:26 • Same for me, still new to this and already forgot about it. Guess using DECIMAL would be perfect for me. Thanks for reminding me of DECIMAL :-) I also think you are right that price precision in general depends on the exchange, so likely your answer is the final one, though one still has to figure out which exchange uses the highest precision for prices. – stefan.at.wpf Jan 16 at 17:19 • Pro tip: If this is going to be anywhere near production code, please do read up on the pros and cons of DECIMAL or get in touch with DB pros... If this is for a little project, then don’t worry and just fire away. – Kermittfrog Jan 16 at 19:37 • @Kermittfrog for now it's a private project. But I am curious. Can you provide more details / recommend specific resources? What could be an alternative? – stefan.at.wpf Jan 16 at 23:15 For listed US equities you will need to use a float for quantity and price. Fractional shares will often result from corporate actions (aquisitions, splits, etc). The sub-penny rule mentioned above is for display purposes. You can't put an order onto a regulated US exchange at anything other than a penny increment. But, you can trade at virtually any price. You will sometimes find that your orders execute at points between two pennies (eg:$17.0025) as you get a price improvement from an executing broker.