title: Go Protobuf Precision Decimals
body: <h3>What is the correct <a href="https://developers.google.com/protocol-buffers/docs/proto3#scalar" rel="noreferrer">scalar type</a> to use in my protobuf definition file, if I want to transmit an arbitrary-precision decimal value?</h3>
  
  <p>I am using <a href="https://github.com/shopspring/decimal" rel="noreferrer">shopspring/decimal</a> instead of a float64 in my Go code to prevent math errors.  When writing my protobuf file with the intention of transmitting these values over gRPC, I could use:</p>
  
  <ul>
  <li><code>double</code> which translates to a float64</li>
  <li><code>string</code> which would certainly be precise in its own way but strikes me as clunky</li>
  <li>Something like <a href="https://github.com/mgravell/protobuf-net/blob/59b83356149a6df5027631421e2d6e03c8708725/src/Tools/bcl.proto#L72" rel="noreferrer">decimal</a> from <a href="https://github.com/mgravell/protobuf-net" rel="noreferrer">mgravell/protobuf-net</a>?</li>
  </ul>
  
  <p>Conventional wisdom has taught me to skirt floats in monetary applications, but I may be over-careful since it's a point of serialization.</p>