Swift:如何包含或使用darwin compactdecimalformat?

我一直在研究并尝试编写一种紧凑的数字格式,也就是所谓的小规模格式化程序,或者在Swift中将大数字化为较小的数字。

I suddenly thought rather than trying to recode the wheel maybe Unicode already solved this issue and saw that there is indeed some code to compact larger numbers.

In the open-source code for Apple Swift on Github there is a reference to compactdecimalformat.h at:

https://github.com/apple/swift-corelibs-foundation/blob/master/bootstrap/x86_64-apple-darwin/usr/local/include/unicode/compactdecimalformat.h

在其中,它指向numberformatter.h;。我在Unicode ICU 67.1中找到了一个参考:

https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/numberformatter_8h.html

However, I am not sure how to use it. I've imported Darwin, but I am not sure how to actually call compactdecimalformat or the public identifier DecimalFormat

我想对其进行一些数字测试,以查看它是否是我正在寻找的压缩/短缩放数字。

因此,我的问题是,如何包含和使用Darwin导入中附带的compactdecimalnumber.h文件?

谢谢你