Change number format in output yaml files

asked 2015-06-22 23:32:26 -0600

luisruiz gravatar image

I am writting data to a yaml file, but I noticed that when I write a matrix of floats, (or doubles) if some value is e.g. 0.01, it writes 1.0000000000000000e-02. Is there a way to set the output format to 0.01 or to shorten the output number?

edit retag flag offensive close merge delete

Comments

I have a large matrix. I am writting data to the yaml file on each iteration. I want to know if the number format can be changed so the matrix can be represented in a more "user friendly" way and to reduce the file size.

luisruiz gravatar imageluisruiz ( 2015-06-22 23:43:21 -0600 )edit

I think that is the representation the most precise, so, maybe writing your own function for "user friendly" display, or just print it in console...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-06-23 02:27:02 -0600 )edit