我有HTML变量存储值835我希望在835之前应该有$这样显示价值$ 835。
same_vaccination_severeei_unvaccinated_val_1.value = ((parseFloat(mixed_population_ci_unvaccinated_val_1.value) * parseFloat(if_influenza_severe_unvaccinated_val_1.value)/10000)*100).toFixed(2) + $;
答案 0 :(得分:1)
same_vaccination_severeei_unvaccinated_val_1.value = '$' + ((parseFloat(mixed_population_ci_unvaccinated_val_1.value) * parseFloat(if_influenza_severe_unvaccinated_val_1.value)/10000)*100).toFixed(2);
答案 1 :(得分:0)
试试这个
same_vaccination_severeei_unvaccinated_val_1.value = "$"+((parseFloat(mixed_population_ci_unvaccinated_val_1.value) * parseFloat(if_influenza_severe_unvaccinated_val_1.value)/10000)*100).toFixed(2);