Mam problem z groszami, w mysql wszystko jest dobrze. ale w gui przy liczbie 1000000+ nie pokazuje setnej grosza a przy 10 mln+ nie wy?wietla w og?le groszy jest (liczba.00) Jak to naprawi??
Witam, mam takie pytanie czy da si? w Mysql ustawi? tak aby zapisywa?o kwot? z groszami np. mam 1.54 PLN i po wej?ciu na serwer dodaje 2.00 i chce si? dowiedzie? jak zrobi?, aby zapisywa?o 1.54 i by?o po wej?ciu na serwer?
Witam ot?? napisa?em grosze na hudzie za pomoca string.gsub i chcialbym zeby przy przelewie,wystawianiu ceny auta. Jak wpisuje /przelej id 433.31 to przelewa sie 433 i zostaje 0.31. Jak zrobi? by grosze te? sie przelewaly?
KOD:
[lua]function zaplac(plr, cmd, target, ile)
if not getElementData(plr, "user:logged") then return end
if not target or not ile then
outputChatBox("#ffc800U?yj: #eeeeee/"..cmd.." [ID/Nazwa gracza] [Kwota]", plr, 255, 255, 255, true)
return
end
local target = findPlayer(plr, target)
if not target then return end
local ile = tonumber(ile)
string.format("%.2f",ile/100)
string.gsub(ile, "^(-?%d+)(%d%d)", '%1,%2')
if not ile then
exports.rpg_noti:createNotification(plr, "error", "Wpisana wartos? musi by? liczb?", 1)
return
end
local ile = math.floor(ile)
if ile < 0.01 then
exports.rpg_noti:createNotification(plr, "error", "Wpisana wartos? musi by? wi?ksza od 0", 1)
return
end
local money1 = getPlayerMoney(plr)
string.format("%.2f",money1/100)
string.gsub(money1, "^(-?%d+)(%d%d)", '%1,%2')
if money1 < ile then
exports.rpg_noti:createNotification(plr, "error", "Nie posiadasz przy sobie takiej sumy", 1)
return
end
takePlayerMoney(plr, ile*100)
givePlayerMoney(target ,ile*100)
string.gsub(ile, "^(-?%d+)(%d%d)", '%1,%2')
Witam, mam problem a mianowicie chcia?bym napisa? system groszy na sw?j serwer i tu jest moje pytanie czego opr?cz elementdaty u?y? do tego?
Za pomoc daje