Skip to content

'e'和‘E'并不是用于小写字母和大写字母格式化 #137

@chinuno-usami

Description

@chinuno-usami

操作符和格式化字符串中提到

还有两个比较有用的type是e和E。他们分别是小写字母和大写字母格式化,别在苦逼兮兮的写大小写转换函数了,Rust早帮你设计好了。

我在格式化字符串成小写的时候编译报错

error: the trait `std::fmt::LowerExp` is not implemented for the type `str` 

查了查文档应该是用于转换成科学计数法中e的大小写用的

Format trait for the e character.
The LowerExp trait should format its output in scientific notation with a lower-case e.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions