Announcement

Collapse
No announcement yet.

math question calculation (percentages)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • math question calculation (percentages)

    Hi:
    To anybody who knows or are math experts, if i do this calculation for percentages:

    3000 megabytes -----------100 %
    x megabytes ----------- 50 %

    it should be calculated as follows:

    3000 * 50/100 = 1500

    In programming for example to make progress install, how do you translate pure maths formula to lua? its correct write this as is it on the text progress ( for example or anywhere )?

  • #2
    Code:
    X [COLOR="#FF0000"]=[/COLOR] [COLOR="#000000"]5[/COLOR]
    Y [COLOR="#FF0000"]=[/COLOR] [COLOR="#000000"]10[/COLOR]
    Z [COLOR="#FF0000"]=[/COLOR] [COLOR="#0000FF"]math.floor[/COLOR](X[COLOR="#FF0000"]/[/COLOR]Y [COLOR="#FF0000"]*[/COLOR] [COLOR="#000000"]100[/COLOR])
    Dialog[COLOR="#FF0000"].[/COLOR]Message([COLOR="#800080"]""[/COLOR][COLOR="#FF0000"],[/COLOR]Z[COLOR="#FF0000"]..[/COLOR][COLOR="#800080"]"%"[/COLOR])

    Comment


    • #3
      Thanks mate, very helpful the idea to assigning number variables solves directly any number needed to calculate for

      Comment

      Working...
      X