Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mike-zarandona/statamic-leadingzeros
Statamic variable modifier to add leading zeros to output
https://github.com/mike-zarandona/statamic-leadingzeros
Last synced: about 1 month ago
JSON representation
Statamic variable modifier to add leading zeros to output
- Host: GitHub
- URL: https://github.com/mike-zarandona/statamic-leadingzeros
- Owner: mike-zarandona
- Created: 2015-12-28T21:06:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-28T21:06:57.000Z (almost 9 years ago)
- Last Synced: 2023-08-07T13:11:28.717Z (over 1 year ago)
- Language: PHP
- Size: 0 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Statamic-LeadingZeros
Add leading zeros to numbers.## What is this?
This is a variable modifier for [Statamic](http://statamic.com). Use this modifier to add to add leading zeros to your value's output. You can pass in the number of total places you'd like your number to have.## Examples
The variable
```
// output = 1
{{ output|leadingzeros:3 }}
// 001// output = 123
{{ output|leadingzeros:5 }}
// 00123// output = 234
{{ output|leadingzeros:2 }}
// 234
```## Installation
- Create a new folder inside of your `_add-ons` folder called `leadingzeros`.
- Place `mod.leadingzeros.php` inside `_add-ons/leadingzeros/`.## Changelog
1.0.0 - Initial release## Author
Mike Zarandona | [@mikezarandona](http://twitter.com/mikezarandona)