Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

修正数据类型转换相关的一些描述 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
city2011 wants to merge 18 commits into coderit666:main
base: main
Choose a base branch
Loading
from city2011:main
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7fbaf7c
(fix)convert str3 (string) to int word fix
city2011 Jan 24, 2022
a796db6
(style)text-align
city2011 Jan 24, 2022
89adc54
(fix) fix some code running result
city2011 Jan 24, 2022
510616c
Merge pull request #1 from city2011/feature-update-some-code
city2011 Jan 24, 2022
2371d93
Merge pull request #2 from city2011/feature-fix-some-description
city2011 Jan 24, 2022
b20143c
update goguide code
Jan 30, 2022
281803e
add chapter map goguide code
Jan 30, 2022
9989aa5
go-guide-code pointer code
Jan 30, 2022
74b57d0
interface test 01
city2011 Feb 3, 2022
ee1342d
go has no extends system
city2011 Feb 4, 2022
b5eaba2
errorPanicTest
city2011 Feb 6, 2022
14e616b
finish strings func study and code
city2011 Feb 7, 2022
df472f1
finish go time reg chapter and code
city2011 Feb 8, 2022
03d0b5b
fileTest half
Feb 11, 2022
16d326a
fileOp in win finish code and learn
city2011 Feb 12, 2022
59587af
fix something in chapter concurrency goruntine
city2011 Feb 13, 2022
f72a394
chan is nb tech in go
city2011 Feb 13, 2022
a618afe
finish chan chapter
city2011 Feb 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
(fix) fix some code running result
  • Loading branch information
city2011 committed Jan 24, 2022
commit 89adc547f68395991c7c3ca8422ddee6b5e3329e
7 changes: 4 additions & 3 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1310,8 +1310,9 @@ int main(){
// 第二个参数: 转换为什么格式,f小数格式, e指数格式
// 第三个参数: 转换之后保留多少位小数, 传入-1按照指定类型有效位保留
// 第四个参数: 被转换数据的实际位数,float32就传32, float64就传64

// 将float64位实型,按照小数格式并保留默认有效位转换为字符串
str3 := strconv.FormatFloat(num5, 'f', -1, 64)
str3 := strconv.FormatFloat(num5, 'f', -1, 32)
fmt.Println(str3) // 3.1234567
str4 := strconv.FormatFloat(num5, 'f', -1, 64)
fmt.Println(str4) // 3.1234567890123457
Expand All @@ -1320,8 +1321,8 @@ int main(){
fmt.Println(str5) // 3.12
// 将float64位实型,按照指数格式并保留2位有效位转换为字符串
str6 := strconv.FormatFloat(num5, 'e', 2, 64)
fmt.Println(str6) // 3.12

fmt.Println(str6) // 3.12e+00
var num6 bool = true
str7 := strconv.FormatBool(num6)
fmt.Println(str7) // true
Expand Down

AltStyle によって変換されたページ (->オリジナル) /