The ImperialMassFormatter promotes imperial mass values between oz, lb, st, and ton.
- Non-numeric input is returned unchanged.
- Promotion is based on magnitude.
- Output uses symbols only (no spaces), e.g.
1lb,8oz.
use Respect\StringFormatter\ImperialMassFormatter;
$formatter = new ImperialMassFormatter('oz');
echo $formatter->format('16');
// Outputs: 1lb__construct(string $unit)
The $unit is the input unit (the unit you are providing values in).
Accepted units: oz, lb, st, ton.
tonrepresents the imperial long ton (2240lb).