title: Need Jackson serializer for Double and need to specify precision at runtime
body: <p>There are many posts about creating Jackson serializers for numbers, currency, etc. For engineering applications, there is often a need to set the precision on numbers based on the units or other criteria. </p>
  
  <p>For example, spatial coordinates might be constrained to 5 or 6 digits after the decimal point, and temperature might be constrained to 2 digits after the decimal point. Default serializer behavior that has too many digits or truncated exponential notation is not good.  What I need is something like:</p>
  
  <pre><code>@JsonSerialize(using=MyDoubleSerializer.class, precision=6) double myValue;
  </code></pre>
  
  <p>and better yet be able to specify the precision at run-time.  I am also using a MixIn.  I could write a serializer for each class but hoped to specify on specific values.  </p>
  
  <p>Any ideas would be appreciated.</p>