diff options
-rw-r--r-- | lib/LuaOCCI.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/LuaOCCI.cc b/lib/LuaOCCI.cc index f6e2501..8325bba 100644 --- a/lib/LuaOCCI.cc +++ b/lib/LuaOCCI.cc @@ -954,9 +954,20 @@ int sLua_EncapOCCI_Statement::EncapOCCI_Statement_proceed_unprotected(Lua * L, i break; case STATEMENT_SETNUMBER: { - Number x; - x.fromText(global_env, L->tostring(3).to_charp(), n == 3 ? L->tostring(4).to_charp() : "TM9"); + Number x(0); + String num = L->tostring(3); + char format[128]; + int dotpos; + memset(format, '9', num.strlen()); + format[num.strlen()] = 0; + dotpos = num.strchr('.'); + if (dotpos != -1) { + format[dotpos] = '.'; + } + x.fromText(global_env, L->tostring(3).to_charp(), n == 3 ? L->tostring(4).to_charp() : format); stmt->setNumber(L->tonumber(2), x); + + std::string s = x.toText(global_env, "TM9"); } break; case STATEMENT_SETPREFETCHMEMORYSIZE: |