typst / typst/typst

`decimal` Literals

Open
#8,093 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request scripting syntax
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

It would be helpful to have a more concise way to specify numbers of type decimal. JavaScript solved a similar issue with BigInts by using a postfix.

decimal("0.5") // current
0.5d           // proposed
Use Case

We are currently not using decimals in some places it would make sense to, simply because decimal("0.5") is too long and would visually polute the codebase.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue proposes decimal("0.5") and the postfix form 0.5d, but names no files, tests, or compiler entry points. Start by locating Typst's numeric literal parsing and decimal representation, then determine the syntax and semantics needed for the proposal. Done means the feature is specified, implemented, and covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.