Giter Site home page Giter Site logo

sjkelly / scalednumbersoutput.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliacomputing/scalednumbersoutput.jl

0.0 1.0 0.0 8 KB

Pretty printing of numbers that are rounded and in SI notation (eg 3.25n)

License: MIT License

Julia 100.00%

scalednumbersoutput.jl's Introduction

ScaledNumbersOutput

This package provides a utility function for pretty printing numbers. The to_SI(val; sigdigits) takes a number and converts it to the a string using SI scaling prefixes. For example:

julia> to_SI(75.2e10)
"752G"

julia> to_SI(0.000000021)
"21n"

By default numbers are rounded to 5 digits but that can be chosen:

julia> to_SI(1/9)
"0.11111"

julia> to_SI(1/9, sigdigits=7)
"0.1111111"

The following scale factors are supported:

Symbol Scaling Factor
P 10^15
T 10^12
G 10^9
M 10^6
k 10^3
m 10^-3
u 10^-6
n 10^-9
p 10^-12
f 10^-15
a 10^-18

See also

The following packages are similar:

scalednumbersoutput.jl's People

Contributors

glenhertz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.