some fixes in quantity

This commit is contained in:
jriegel
2013-12-06 23:25:19 +01:00
parent 83e63a67b1
commit 75216d9d8c
3 changed files with 13 additions and 4 deletions

View File

@@ -82,8 +82,17 @@ PyObject* QuantityPy::pow(PyObject * args)
PyObject* QuantityPy::getUserPrefered(PyObject *args)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
QString uus;
double factor;
Py::Tuple res(3);
QString uss = getQuantityPtr()->getUserString(factor,uus);
res[0] = Py::String(uss.toLatin1());
res[1] = Py::Float(factor);
res[2] = Py::String(uus.toLatin1());
return Py::new_reference_to(res);
}
PyObject* QuantityPy::getValueAs(PyObject *args)