void NumberDecimalInfo::Functions::toString::call(JSContext* cx, JS::CallArgs args) { Decimal128 val = NumberDecimalInfo::ToNumberDecimal(cx, args.thisv()); str::stream ss; ss << "NumberDecimal(\"" << val.toString() << "\")"; ValueReader(cx, args.rval()).fromStringData(ss.operator std::string()); }
void NumberDecimalInfo::Functions::toJSON::call(JSContext* cx, JS::CallArgs args) { Decimal128 val = NumberDecimalInfo::ToNumberDecimal(cx, args.thisv()); ValueReader(cx, args.rval()).fromBSON(BSON("$numberDecimal" << val.toString()), nullptr, false); }