Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#310 closed bug (invalid)


Reported by: Artur Owned by:
Priority: normal Milestone: 4.0-2016R3
Component: Gauge.mui Version: 4.0-2016R2
Severity: minor Keywords:
Cc: OS Platform: AmigaOS3
Blocked By: Blocking:
Release Notes:



    sprintf(perc, "%d %% ",100);
    set(obj->GA_progress, MUIA_Gauge_Current, atoi(perc));

Expected results

Show "%" after 100 value.

Actual results

Not displaying "%"


MUI 3.8


Change History (2)

comment:1 Changed 4 years ago by Thore Böckelmann

Milestone: future release4.0-2016R4
Priority: undecidednormal
Resolution: invalid
Status: newclosed

Why should the percent sign be displayed? MUIA_Gauge_Current takes an integer value, which your code creates from the string. It doesn't matter if the string contains just a number or a number plus the additional percent sign. The atoi() function will ignore all non-numeric characters. Unfortunately you didn't provide any information about how you create your gauge object.

If you want something like "42% done" to be displayed you need to create your gauge object like this:

gauge = GaugeObject,
  MUIA_Gauge_Horiz, TRUE,
  MUIA_Gauge_InfoText, "%ld%% done",

set(gauge, MUIA_Gauge_Current, 42);

This behaviour has not changed since MUI 3.8.

comment:2 Changed 4 years ago by Thore Böckelmann

Milestone: 4.0-2016R44.0-2016R3
Note: See TracTickets for help on using tickets.