A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/protocolbuffers/protobuf/commit/5b54ee3c91e9d6d7790488aed35b3f6b7d081281 below:

Make Py JSON `float_precision` apply to both float and double fields. · protocolbuffers/protobuf@5b54ee3 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+4

-5

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+4

-5

lines changed Original file line number Diff line number Diff line change

@@ -316,11 +316,10 @@ def _FieldToJsonObject(self, field, value):

316 316

return _INFINITY

317 317

if math.isnan(value):

318 318

return _NAN

319 -

if field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_FLOAT:

320 -

if self.float_format:

321 -

return float(format(value, self.float_format))

322 -

else:

323 -

return type_checkers.ToShortestFloat(value)

319 +

if self.float_format:

320 +

return float(format(value, self.float_format))

321 +

elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_FLOAT:

322 +

return type_checkers.ToShortestFloat(value)

324 323 325 324

return value

326 325

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4