N3Roaster / typica

Free software for coffee roasting operations.
https://typica.us
MIT License
26 stars 8 forks source link

How can I set default to "KG"? #131

Closed Kidazpan closed 9 years ago

Kidazpan commented 9 years ago

Hi guys,

I don't want a program to change my data to from "KG" to "Pound"?

Any suggestions?

Cheers,Ed.

N3Roaster commented 9 years ago

There are a couple ways the data storage could have been handled. The approach I took with Typica was to pick a unit (it hardly matters what) and use that consistently, but then every place where data is entered or displayed, it should certainly be possible to pick something else and have the appropriate conversion take place. The alternative is to still allow people to pick anything and store that unit data along with the measurement which still requires all of that conversion logic and complicates all aggregate calculations. It would be a lot of error prone work for something that most people would never notice.

If the idea here is using the database with other programs that cannot perform the appropriate conversions, one option would be to enter the data as Kg and just ignore the Lb labels, though that limits your ability to use other units later and increases the communication burden if other staff members start using the program. I don't recommend doing that, but it would work.

What I would consider correct handling of this would be for every interface that deals with weight data to allow unit selection including Kg and for this to be a saved setting. Presently there's a setting that's shared among all reports that do it this way so changing the setting once in one report changes the default for all future reports. I haven't gotten around to adding that unit selection every place that needs it and there are some open issues related to this already: #37 #40 #41 and #42 . If you notice other areas where this is not handled correctly, feel free to open an issue on the specific view lacking that feature or better yet submit a patch to fix the issue. Unit conversions are straightforward and there are plenty of examples in the Typica code base covering how to deal with this.