Originally posted by: SystemAdmin
Ed,
first of all the function has to be coded in a mod-file.
What I have is a mod-file that is shared between several
OPL-projects (call it shared_functions.mod - ar alike).
In this mod file you should have soemthing like :
execute Utilities{
function toFixedPrecision(v, prec) {
// as posted above ....
}
}
The extra file is not required but convenient ...
In the mod-file representing the current math model
(whatever.mod) should have a
include "shared_functions.mod";
In whatever.mod you use the function as you indicated
execute{
writeln(x, " = ", toFixed(x,2));
}
In case that you still get errors please sedn me a
simplified OPL-project by personal mail. I will have
a look at it.
Hope that helps.
Best regards
Norbert
#DecisionOptimization#OPLusingCPLEXOptimizer