dartfmt

package
v1.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dartfmt formats numbers the way Dart's toString and toStringAsFixed do, so that text printed by ported Flutter code (diagnostics, dumps) reads the same.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Double

func Double(x float64) string

Double formats x as Dart's double.toString does: "1.0" for an integral value, the shortest digits that read back as x otherwise, and an exponent ("1e-5", "1e+21") below 1e-4 and from 1e21.

func Duration

func Duration(d time.Duration) string

Duration formats d as Dart's Duration.toString does: "H:MM:SS.mmmmmm", with a leading "-" for a negative duration and any number of hour digits.

func ToStringAsFixed

func ToStringAsFixed(x float64, digits int) string

ToStringAsFixed formats x with the given number of decimals as Dart's toStringAsFixed does: exact ties are rounded away from zero, where Go's formatting rounds them to even.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL