Actions
Feature #1410
openAdd pretty-print sink options to override how to format floating point numbers
Start date:
02/21/2024
Due date:
% Done:
0%
Estimated time:
Description
Babeltrace 2, just like its predecessor babeltrace 1.5, uses "%g" to print floating point numbers.
It would be useful to let users optionally override the formatting for floating point numbers, perhaps with a pretty print sink option. They could then choose if exponent notation should be used or not, choose the precision, etc.
Updated by Philippe Proulx about 1 month ago
I wouldn't let a user control the exact partial format string (it's dangerous and we could even use something else to format in the future, for example {fmt}), but she could provide all the details as dedicated parameters, for example (using YAML for clarity):
params:
format:
float:
mode: exponential
show-sign: yes
zero-pad: yes
minimum-width: 7
precision: 4
Would this work?
Actions