The precision is a decimal number indicating how many digits should be displayed after the decimal point for a floating point value formatted with 'f' and 'F', or before and after the decimal point for a floating point value formatted with 'g' or 'G'. For non-number types the field indicates the maximum field size - in other words, how many characters will be used from the field content
这只是旧的字符串格式。 我想你可以用一个“.L”,其中L是把字符串截短到你喜欢的任何长度的长度。例如:
将长度截断为5个字符。
有点难找到,但他们确实在docs中提到过:
相关问题 更多 >
编程相关推荐