Package org.luaj.vm2

Examples of org.luaj.vm2.LuaValue.todouble()


                        actualParam = param.get("raw").checkjstring();
                    } else if (!param.get("num").isnil()) {
                        if (param.get("num").isnumber()) {
                            LuaNumber number = param.get("num").checknumber();
                            NumberFormat nf = NumberFormat.getInstance(Locale.forLanguageTag(lang));
                            actualParam = nf.format(number.todouble());
                        } else {
                            actualParam = param.get("num").tojstring();
                        }
                    } else {
                        actualParam = "unknown";
View Full Code Here


        break;
      case LuaValue.TNUMBER:
        switch (NUMBER_FORMAT) {
        case NUMBER_FORMAT_FLOATS_OR_DOUBLES:
          writer.write(LuaValue.TNUMBER);
          dumpDouble(o.todouble());
          break;
        case NUMBER_FORMAT_INTS_ONLY:
          if ( ! ALLOW_INTEGER_CASTING && ! o.isint() )
            throw new java.lang.IllegalArgumentException("not an integer: "+o);
          writer.write(LuaValue.TNUMBER);
View Full Code Here

          if ( o.isint() ) {
            writer.write(LuaValue.TINT);
            dumpInt(o.toint());
          } else {
            writer.write(LuaValue.TNUMBER);
            dumpDouble(o.todouble());
          }
          break;
        default:
          throw new IllegalArgumentException("number format not supported: "+NUMBER_FORMAT);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.