Passing Decimals with Protobuf across services
We have proto messages that ideally would contain a decimal as a 开发者_如何学JAVApart of the message. This proto file is being used by both a Java and a .NET client.
Since we cannot use decimal, what would the recommended approach be for passing these values?
How many significant digits?
If you know ahead of time, you could use a fixed-point representation, e.g. an integer which is treated as units of 10-6 or whatever is most appropriate.
If not, well, there's string…
精彩评论