Skip to content

Numeric seperator with _ #92

@hugoclrd

Description

@hugoclrd

Context

Developers often have to deal with big numbers in Clarity.
Example in sip-031 boot contract

Problem

Big numbers are hard ot read. How many uSTXs is that:

(define-constant INITIAL_MINT_AMOUNT u200000000000000) 

Workaround

Developers often rely on comments

(define-constant INITIAL_MINT_AMOUNT u200000000000000) ;; 200,000,000 STX

Suggested improvement

Support for _ numeric separator for int and uint

(define-constant INITIAL_MINT_AMOUNT u200_000_000_000_000)

Related spec in other languages

  • JS supports it (spec)
  • Solidity supports it (spec)
  • Rust supports it
  • Go supports it

Metadata

Metadata

Assignees

No one assigned

    Labels

    SSmall task; <= 1 day in scopeclarity-next-candidateChanges that are considered to be included in the next version of Claritysyntax-changeThe issue describes a change in syntax only.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions