回答編集履歴
1
編集
answer
CHANGED
@@ -13,4 +13,8 @@
|
|
13
13
|
**※上記の、"%%"を使う方法は推奨しない旨の記事もありました**
|
14
14
|
多言語対応を想定している場合は、以下記事の様に「NumberFormatter.Style」の利用を推奨します。
|
15
15
|
[参考リンク:How to format percent in Swift](https://onmyway133.github.io/blog/How-to-format-percent-in-Swift/)
|
16
|
-
[参考リンク:NumberFormatter.Style](https://developer.apple.com/documentation/foundation/numberformatter/style)
|
16
|
+
[参考リンク:NumberFormatter.Style](https://developer.apple.com/documentation/foundation/numberformatter/style)
|
17
|
+
|
18
|
+
**補足**
|
19
|
+
NumberFormatterを利用すると、自動的に位の移動もされる点はご注意ください。
|
20
|
+
「let A = 4.258」の”4.258”という値を、NumberFormatter(parcent)で変換すると「425.8%」となってしまうかと思います。
|