This class can convert a number to a string appending a prefix.

It can take a number and calculate its order of magnitude to determine what is the prefix to be appended to the number, for instance converting 250000 to 250K.

The conversion can be configured to define rounding rules, the numeric base, and the text of the prefixes.

Features

  • Bidirectional conversions between numbers and their prefixed number (with properly configured encoding)
  • Adjustable grade of rounding (if by significant digits, or by decimals)
  • For the conversion from number to number with prefix, you can specify if you want the output to be in a single string, or the number and prefix alone.
  • Can be extended with other bases, just adding the settings for a base in a config file of that base

Project Samples

Project Activity

See All Activity >

Follow PHP Prefixer

PHP Prefixer Web Site

You Might Also Like
Achieve perfect load balancing with a flexible Open Source Load Balancer Icon
Achieve perfect load balancing with a flexible Open Source Load Balancer

Take advantage of Open Source Load Balancer to elevate your business security and IT infrastructure with a custom ADC Solution.

Boost application security and continuity with SKUDONET ADC, our Open Source Load Balancer, that maximizes IT infrastructure flexibility. Additionally, save up to $470 K per incident with AI and SKUDONET solutions, further enhancing your organization’s risk management and cost-efficiency strategies.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PHP Prefixer!

Additional Project Details

Programming Language

PHP

Registered

2014-08-05