From 6d322b883faf5c9b5be51b24999cc6ea3b609741 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 2 Jun 2008 21:32:13 +0000 Subject: Disregard TM9 in setNumber, and rather try to autodetect number format. --- lib/LuaOCCI.cc | 15 +++++++++++++-- 1 file 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: -- cgit v1.2.3