public TOverloadResult resultType() {
return TOverloadResult.custom(new TCustomOverloadResult() {
@Override
public TInstance resultInstance(List<TPreptimeValue> inputs, TPreptimeContext context) {
TPreptimeValue valueToRound = inputs.get(0);
ValueSource roundToPVal = signatureStrategy.getScaleOperand(inputs);
int precision, scale;
if ((roundToPVal == null) || roundToPVal.isNull()) {
precision = 17;
int incomingScale = valueToRound.type().attribute(DecimalAttribute.SCALE);
if (incomingScale > 1)
precision += (incomingScale - 1);
scale = incomingScale;
} else {
scale = roundToPVal.getInt32();
TInstance incomingInstance = valueToRound.type();
int incomingPrecision = incomingInstance.attribute(DecimalAttribute.PRECISION);
int incomingScale = incomingInstance.attribute(DecimalAttribute.SCALE);