added scalar support in calc_conversion function