<div dir="ltr"><div dir="ltr"><div dir="ltr" class="gmail_attr">On Tue, Mar 10, 2020 at 10:31 AM Brett Nemeroff <<a href="mailto:brett@nemeroff.com">brett@nemeroff.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">Liviu,</div><div dir="auto">My preference would be to default to 8, but make it defined in the header file for those who want to recompile it. 6 is ok, it’s usually the minimum precision that is acceptable. </div></div></blockquote></div><div dir="ltr"><br></div><div dir="ltr">My comment about significant digits was with regards to having extraneous trailing zeros, regardless of how many. Depending on the other value used in a calculation, 0.0019 versus 0.001900 might dictate rounding at a different number of decimal places. This is why I suggested grabbing the number of decimal places from the SQL response. My newbie googling of C printf/scanf indicates you can pass the number of decimal places via the ".precision" format specifier as a value or reference. There's a great answer on the topic here: <a href="https://stackoverflow.com/a/19897395">https://stackoverflow.com/a/19897395</a> and some followup on C display precision versus mathematical precision and significant digits.<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br></div><div>It's probably a corner case. This stuff was pounded into me during high school chemistry class :)</div><div dir="ltr"><br></div><div dir="ltr">Regards,<div><br></div><div><p style="font-family:helvetica,arial,sans-serif;font-size:12px;margin:0px;padding:0px 0px 20px;color:rgb(0,0,0)"><strong>Calvin Ellison</strong><br>Senior Voice Operations Engineer<br><a href="mailto:calvin.ellison@voxox.com" style="text-decoration:none;color:rgb(14,123,174)" target="_blank">calvin.ellison@voxox.com</a></p></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto"></div></div>
</blockquote></div></div>