HomeFreeBSD

strfmon: Fix alignment when enclosed by parentheses

Description

strfmon: Fix alignment when enclosed by parentheses

Take into consideration the possibility of quantities enclosed by
parentheses when aligning.

Matches the examples from The Open Group's:

Format Before After
%(#5n [$ 123.45] [ $ 123.45 ] Use an alternative pos/neg style

[($   123.45)]  [($   123.45)]
[$ 3,456.78]    [ $ 3,456.78 ]

%!(#5n [ 123.45] [ 123.45 ] Disable the currency symbol

[(   123.45)]   [(   123.45)]
[ 3,456.78]     [  3,456.78 ]

https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon.html

SD5-XSH-ERN-29 is applied, updating the examples for %(#5n and %!(#5n.

Obtained from: Darwin
Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

Details

Provenance
jlduranAuthored on Oct 14 2022, 11:26 PM
kibCommitted on Oct 25 2022, 9:40 PM
Parents
rG6da51e19e347: strfmon: Trim the SPACE from international currency symbol
Branches
Unknown
Tags
Unknown