1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-01 12:08:37 -04:00

lua: Query account balances at dates

This commit is contained in:
2017-01-30 21:04:18 -05:00
parent b7d2273b1c
commit cec769b6b8
4 changed files with 112 additions and 23 deletions

View File

@ -52,6 +52,7 @@ func luaWeakCheckBalance(L *lua.LState, n int) *Balance {
if balance, ok := ud.Value.(*Balance); ok {
return balance
}
L.ArgError(n, "balance expected")
}
return nil
}
@ -109,7 +110,7 @@ func luaBalance__index(L *lua.LState) int {
func luaBalance__tostring(L *lua.LState) int {
b := luaCheckBalance(L, 1)
L.Push(lua.LString(b.Security.Symbol + b.Amount.FloatString(b.Security.Precision)))
L.Push(lua.LString(b.Security.Symbol + " " + b.Amount.FloatString(b.Security.Precision)))
return 1
}