[Fixed] incorrect type casting in ham cost calculation

Change-Id: I76edb47c2db00b78a1108203ae223122a80f557d