Use sign to preserve precision in get_amount

issue3668
review3421002