diff --git a/qalculator.cpp b/qalculator.cpp index 77c875d..276d125 100644 --- a/qalculator.cpp +++ b/qalculator.cpp @@ -2,6 +2,8 @@ #include #include +EvaluationOptions user_evaluation_options = default_evaluation_options; + const char* qalculate(const char* input, bool exact_mode) { Calculator* c = new Calculator(); c->loadExchangeRates(); @@ -10,11 +12,11 @@ const char* qalculate(const char* input, bool exact_mode) { std::string Input = input; std::string Output; if (exact_mode) { - default_user_evaluation_options.approximation = APPROXIMATION_EXACT; + user_evaluation_options.approximation = APPROXIMATION_EXACT; } else { - default_user_evaluation_options.approximation = APPROXIMATION_APPROXIMATE; + user_evaluation_options.approximation = APPROXIMATION_APPROXIMATE; } - Output = c->calculateAndPrint(Input,2000,default_user_evaluation_options); + Output = c->calculateAndPrint(Input,2000,user_evaluation_options); delete c; char * output = new char [Output.length()+1]; Output.copy(output,Output.length());