round numbers to next integer

This commit is contained in:
Marco 2024-06-11 19:11:23 +02:00
parent be2ab69a3f
commit 9953635ad3
2 changed files with 4 additions and 4 deletions

View File

@ -16,9 +16,9 @@ class FoodEntryWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 4.0),
child: RowWidget(
Text(entry.name),
Text(entry.mass.toString()),
Text(entry.kcalPerMass.toString()),
Text((entry.mass * entry.kcalPerMass / 100).toString()),
Text(entry.mass.ceil().toString()),
Text(entry.kcalPerMass.ceil().toString()),
Text((entry.mass * entry.kcalPerMass / 100).ceil().toString()),
IconButton(
style: IconButton.styleFrom(padding: EdgeInsets.zero),
onPressed: () {

View File

@ -26,7 +26,7 @@ class _SumWidgetState extends State<SumWidget> {
null,
null,
const Text("kcal heute:"),
Text('${sum.toString()}/${state.kcalLimit}'),
Text('${sum.ceil().toString()}/${state.kcalLimit.ceil()}'),
null,
);
},