Spring会正确地为“floatList”属性填上浮点数,而不是字符串,因为它能非常聪明地意识到它需要执行类型转换。
Spring will correctly populate the "floatList" property with floats, rather than Strings, as it is smart enough to realize that it needs to perform the type conversion.
使用指定的区域性特定格式设置信息,将数字的指定字符串表示形式转换为等效的单精度浮点数。
Converts the specified string representation of a number to an equivalent single-precision floating-point number, using the specified culture-specific formatting information.
返回从字符串转换得到的浮点数。
应用推荐