开发者

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…

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜