Closed regisoc closed 4 weeks ago
@driusan I was thinking we could have a (14,4) default which would be backwards compatible with the old (10,0) default but also allow the LINST standard to define the number of digits and number of decimals in the front end? just likesome fields have min and max?
@driusan @ridz1208 I like that idea. I can add that as a new configuration if that is ok for both of you.
@regisoc I'm not sure how the option would work but it sounds good to me. (I think the first part of the (x, y)
can be derived from the min/max that's already there with something like log10(max(abs(min), abs(max)))) + y.
Should I merge this and you'll do it in another PR or do you want to do it in this one?
@driusan @ridz1208 I think it can be merged as is.
The option can be added later as it will only impact both generate_table...
scripts.
Brief summary of changes
This PR forces the
decimal(14,4)
(10 digits on the integer part, and 4 digits on the floating point part), instead ofdecimal(10,0)
which is the default fornumeric
and was truncating floating point digits. It only applies this change for instruments that require their own table (non JSON) and havenumeric
attribute.Testing instructions (if applicable)
tools/generate_tables_sql.php
andtools/generate_tables_sql_and_testNames.php
with a non JSON LINST instrument with at least anumeric
type line.decimal(14,4)
type for the numeric attribute, instead of anumeric
attribute.Link(s) to related issue(s)
Resolves #9237