var schemeduration = '1.5';// 1 year and 5 months
var schemeduration= (parseFloat(schemeduration) * 12).toFixed(0) ;
alert(schemeduration);
1.1 = 13 months
1.2 = 14 months
1.3 = 15 months
1.4 = 16 months
1.5 = 17 months
1.6 = 18 months
1.7 = 19 months
1.8 = 20 months
1.9 = 21 months
1.10 = 22 months
1.11 = 23 months
1.12 = 24 months
如何以十进制显示给定年份的确切月份。对于上面给出的它应该显示 17,但我得到的值为 18。一年中有 12 个月我需要以月份计算的输出