Nic Sandfield

NAME

Mojolicious::Plugin::Number::Commify - Numbers 1,000,000 times more readable

SYNOPSIS

  # Mojolicious
  $self->plugin('Number::Commify');

  # Mojolicious::Lite
  plugin 'Number::Commify';

DESCRIPTION

Mojolicious::Plugin::Number::Commify is a Mojolicious plugin for putting commas into big numbers. Sometimes this is 1,000,000 times better than letting the reader try to parse it.

USAGE

The plugin takes an optional 'separator' to use for separating groups of digits. Any length of string can be used, but common choices are dot ('.'), space (' '), or apostrophe ("'"). If no separator is specified, it defaults to comma (',').

  $self->plugin('Number::Commify' => { separator => ' ' });

METHODS

Mojolicious::Plugin::Number::Commify inherits all methods from Mojolicious::Plugin.

register

  $plugin->register(Mojolicious->new);

Register plugin in Mojolicious application.

RATIONALE

It's often useful to have access to a commify function in views, so an easily accessible helper is in order.

COPYRIGHT AND LICENSE

Copyright (C) Benjamin Goldberg, Nic Sandfield

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

SEE ALSO

perlfaq5, Mojolicious::Guides.