[libcalamares] Format floats with trailing digits

- When writing YAML, given a float **always** write
   some decimal digits (e.g. "1.0" rather than "1")
   so that the type of the written-out thing stays
   float.
 - Avoids test failure with the sample `welcome.conf`
   file which reads 1.0 and would write out 1, which then
   led to type differences.
This commit is contained in:
Adriaan de Groot 2020-04-08 17:10:32 +02:00
parent 3b354b8b20
commit 16a5ca2a55

View File

@ -266,7 +266,7 @@ dumpYamlElement( QFile& f, const QVariant& value, int indent )
}
else if ( value.type() == QVariant::Type::Double )
{
f.write( QString::number( value.toDouble() ).toUtf8() );
f.write( QString::number( value.toDouble(), 'f', 2 ).toUtf8() );
}
else if ( value.canConvert( QVariant::Type::ULongLong ) )
{