Forum Navigation
You need to log in to create posts and topics.

How to modify the precision of numbers in export_file()

Hi all,

I was trying to convert lammps data file to lammps dump file using OVITO. However, neither GUI (Export file) nor Python scripting (export_file()) provides the options to modify the precision and format of numbers in the output dump file, for example "%20.17e".

Does anyone have an idea how I can modify the precision of numbers?


Hi Yifan,

While Ovito 2.9 didn't provide an option for this, Ovito 3.0.0 allows you to specify the floating-point output precision for the LAMMPS dump format. You can either control it in the export options dialog that pops up after you've selected the output filename, or by passing the 'precision' keyword argument to the export_file() Python function.


Thanks Alex! The changes you made in ovito 3.0.0 are exactly what I wanted to have. Fantastic job!

New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.