• percentage in mpl

    From dream master@21:1/163 to All on Monday, October 10, 2016 16:51:00
    im trying to get a
    percentage to display correctly. this is the mathvar
    percent : real;beginpercent := 1 / 248
    * 100;writeln(real2str(percent,2));end
    how can i get the decimal to show in the proper place or is there something new?i tried write(percent:62); but thats not supported in mpl.
    any ideas? .úùDre
    am Masterùú. øùú
    ùøøùúùø DoRE!ACiDiC
    !Demonic[dreamland.darktech
    .org]
    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From Gryphon@21:1/120 to dream master on Monday, October 10, 2016 21:22:00
    On 10/10/16, dream master said the following...

    im trying to get a percentage to display correctly. this is the math

    va
    percent : real;

    begin
    percent := 1 / 248 * 100;
    writeln(real2str(percent,2));
    end

    how can i get the decimal to show in the proper place or is there somethin new?

    i tried write(percent:62); but thats not supported in mpl. any ideas?


    Here's what I uses in my Greed game to show the percentage of the play field that got ate.

    Function Score2Str(Sc:LongInt):String
    Var F,B : Integer
    Var Score : LongInt
    Begin
    Score:=(sc*100)/(COLS*ROWS)*100
    F:=Score/100
    B:=Score-(F*100)
    Score2Str:=Int2Str(F)+'.'+PadLt(Int2Str(B),2,'0')
    End

    "No matter where you go, there you are!" - Buckaroo Bonzai

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX (21:1/120)
  • From dream master@21:1/163 to Gryphon on Monday, October 10, 2016 19:58:00
    On 10/10/16, Gryphon said the following...
    Here's what I uses in my Greed game to show the percentage of the play field that got ate.
    Function Score2Str(Sc:LongInt):String


    i tried this
    var
    val1 : real;
    val2 : real;

    begin
    val1 := str2int(stmpup) / 100 //
    val2 := val1 * str2int(stmpdwn);
    real2str(val2,0); i will try your formula see what i get.

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic |08[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)