Tazi0 / esx_invest

ESX invest, invest into companies
GNU General Public License v3.0
14 stars 20 forks source link

Decimals too long #11

Closed Zasty closed 4 years ago

Zasty commented 4 years ago

https://i.imgur.com/Wa19JS9.png more numbers plz xdd (joke)

Can u fix that? Thanks :*

JnKTechstuff commented 4 years ago
    local user = MySQL.Sync.fetchAll('SELECT `amount` FROM `invest` WHERE `identifier`=@id AND active=1', {["@id"] = xPlayer.getIdentifier()})
    local invested = 0
    for k, v in pairs(user) do
        -- print(k, v.identifier, v.amount, v.job)
        invested = math.floor(invested + v.amount)
    end
    TriggerClientEvent("invest:nui", _source, {
        type = "balance",
        player = xPlayer.getName(),
        balance = invested
    })
end)

Under event: invest:balance

Zasty commented 4 years ago

Thanks, i will try this.

Tazi0 commented 4 years ago

@JnKTechstuff thanks ❤️