:orphan:
# PetscFormatConvert
converts %g to [|%g|] so that `PetscVSNPrintf()` can ensure all %g formatted numbers have a decimal point when printed. The decimal point is then used by the `petscdiff` script so that differences in floating point number output is ignored in the test harness. 
## Synopsis
```
PetscErrorCode PetscFormatConvert(const char *format, char *newformat)
```
No Fortran Support


## Input Parameters

- ***format -*** the PETSc format string
- ***size -*** the length of newformat, you can use `PetscFormatConvertGetSize()` to compute the needed size



## Output Parameter

- ***newformat -*** the new format





## Note
Deprecated usage also converts the `%D` to `%d` for 32-bit PETSc indices and to `%lld` for 64-bit PETSc indices. This feature is no
longer used in PETSc code instead use %" PetscInt_FMT " in the format string


## See Also
 `PetscFormatConvertGetSize()`, `PetscVSNPrintf()`, `PetscVFPrintf()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/fileio/mprint.c.html#PetscFormatConvert">src/sys/fileio/mprint.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/mprint.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
