Use scientific notation with a fixed number of significant digits

Bug #1216931 reported by matley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Natural hazards' Risk Markup Language (NRML)
New
Low
Matteo Nastasi

Bug Description

Currently, nrml writers print float numbers by using the standard python printer.

As in most cases, the result of the computation derives from a converging process the actual results (the xml output) could not be "string equal" between different exports. For example a calculation could end up with

<poe>0.00345</poe> or <poe>0.0034499999999</poe>

In order to make the engine more easy to test it is worth to use scientific notation with a significant number of digits (let's say 6) such that the previous example is fixed to

<poe>3.45000E-1</poe>

matley (matley)
description: updated
Changed in oq-nrmllib:
assignee: nobody → Matteo Nastasi (nastasi-oq)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.