I would have it accept GiB and GB and have both transform to base 2, and have an optional boolean flag whose non-default value turns the GB interpretation into base 10, leaving the GiB interpretation unaffected.
attached proof concept based on parser "parse_int" from guc.c
It works well to 1TB what is enough for memory setting, but too low for proposed target.
There are two ways
1. enhance the "parse_int"
2. using independent implementation - there is some redundant code, but we can support duble insted int, and we can support some additional units.