fortran_format

Full name: ase2sprkkr.common.formats.fortran_format

ase2sprkkr.common.formats.fortran_format(value, format=':.12e')[source]

Format the value with a leading zero.

Format the given float number using the given fortran scientific notation format string, but with a leading zero

>>> fortran_format(0.1)
'0.1000000000000e-00'
>>> fortran_format(1, ":> 14.6E")
'  0.1000000E+01'
Parameters
  • value (mixed) – A value to be printed. The value have to be convertable to a float

  • format (str) – Fortran format string with a type ‘e’ or ‘E’. Optional

Returns

output – A string containing the number in scientific notation with a leading zero.

Return type

str