Custom metadata: allow specifying number of decimal places on "decimal number"

Ah, the joys of the float type. I have set up a custom metadata field called “Invoice amount”, with a type of “decimal number”.

When I enter the amount “580.19” and try to imprint this, the imprinter imprints “580.1900000000001” — not very helpful!

I’d like to be able to use this metadata field for numeric calculations, so a text string isn’t going to do it here. I’d also like to not have to show invoice amounts in pennies :slight_smile:

Would it be possible to allow the user to set the number of decimal places to use for a decimal metadata field, either as part of the field’s definition, or when imprinting? (Update: I’ve just tried another one with an amount of “62.10” and it’s imprinted as “62.1”, so being able to set decimal places would definitely be useful here!)

TBH, it’s still a pain having to keep the currency as a separate field, especially since the imprinter puts a load of space between two adjacent fields — could we have a currency type which allows the user to select the currency and then just handles decimal places correctly for the selected currency?

It would also be super useful if a custom metadata field with the date type could be made to default to today rather than 01/01/0001, as I can’t think of too many uses where that would actually be the date the user wanted :grin:

Development will have to assess and investigate these things.

Thanks — I noticed there was a metadata type that had the currency baked in already, but it appears you can only select one currency for all documents, rather than on a per-document basis, so that doesn’t work for my use case.

The next release will fix both issues.