Skip to content

proposal: strconv: dedicated functions for intX, uint and uintX types and decimal numbers for . #76223

@sirkon

Description

@sirkon

Proposal Details

We currently have "int" case handled with strconv.Atoi and strconv.Itoa.

In my practice it is not unexpected to need the same for int8, … int64 and all kinds of uints.

I propose to introduce the following functions:

type convert to string parse from string
int8 strconv.Itoa8 strconv.Atoi8
int16 strconv.Itoa16 strconv.Atoi16
int32 strconv.Itoa32 strconv.Atoi32
int64 strconv.Itoa64 strconv.Atoi64
uint strconv.Utoa strconv.Atou
uint8 strconv.Utoa8 strconv.Atou8
uint16 strconv.Utoa16 strconv.Atou16
uint32 strconv.Utoa32 strconv.Atou32
uint64 strconv.Utoa64 strconv.Atou64

With trivial implementation probably made as strconv.ParseInt(x, 10, 32) wrapper for strconv.Atoi32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions