Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

jqnpm/jq-zeros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jqnpm logotype, a Penrose triangle

Integers and floats as strings, padded with zeros to your liking.

⚠️ This project has been archived

No future updates are planned. Feel free to continue using it, but expect no support.

This is a package for the command-line JSON processor jq. Install the package in your jq project/package directory with jqnpm:

jqnpm install joelpurra/jq-zeros

Usage

import "joelpurra/jq-zeros" as Zeros;

# Zeros::pad: Can pad both integer and fractions.
1.1 | Zeros::pad(3; 3) # "001.100"

# Zeros::pad: Can pad both integer and fractions.
12345.54321 | Zeros::pad(3; 3) # "12345.54321"

# Zeros::pad: Can pad both negative integer and fractions.
-1.1 | Zeros::pad(3; 3) # "-001.100"

# Zeros::pad: Can pad both negative integer and fractions.
-12345.54321 | Zeros::pad(3; 3) # "-12345.54321"

# Zeros::pad: Can pad both integer and fractions without fractions.
1 | Zeros::pad(3; 3) # "001.000"

# Zeros::pad: Can pad both negative integer and fractions without fractions.
-1 | Zeros::pad(3; 3) # "-001.000"

# Zeros::integer: Can pad single digit number to 3 digits.
1 | Zeros::integer(3) # "001"

License

Copyright (c) 2015 Joel Purra https://joelpurra.com/ All rights reserved.

When using jq-zeros, comply to the MIT license. Please see the LICENSE file for details.

About

Integers and floats as strings, padded with zeros to your liking.

Resources

License

Stars

Watchers

Forks

Packages

No packages published