diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-03-01 13:25:11 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-03-01 13:25:11 -0500 |
| commit | 8beee1dcf1baed84e4c783e2e6e81cfa70440481 (patch) | |
| tree | ee6be7edff79fc3c249bcac6464aeed046b665e7 /ui.c | |
| parent | e374704b245fa8781c56f4d3e35ad9e93f42ae9c (diff) | |
| download | volute-8beee1dcf1baed84e4c783e2e6e81cfa70440481.zip | |
format numbers
Diffstat (limited to 'ui.c')
| -rw-r--r-- | ui.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,4 @@ #include <assert.h> -#include <stdio.h> #include <string.h> #include "microui.h" @@ -51,7 +50,7 @@ init_ui(UI *ui) { init_engine(&ui->points[0]); w_init_select(&ui->volume_flow_rate_unit, nelem(volume_flow_rate_units), volume_flow_rate_units); - w_init_label(ui->volume_flow_rate[0]); + w_init_number(ui->volume_flow_rate[0]); } void @@ -128,7 +127,7 @@ set_volume_flow_rate(UI *ui, int idx) { convert = volume_flow_rate_readers[unit_idx]; v = convert(volume_flow_rate(&ui->points[idx])); - snprintf(ui->volume_flow_rate[idx], sizeof(ui->volume_flow_rate[idx]), "%f", v); + w_set_number(ui->volume_flow_rate[idx], v); } void |