What does NSNumberFormatter -maximumSignificantDigits describe?

There is no text in the documents about what this means, but it is very important to understand so as not to encounter difficulties. Does anyone know what this means "significant digits" of a number?

+4
source share
2 answers

See here for a good guide on significant numbers. A very simple explanation: the number of digits that is used for calculations in your application.

0
source

Although another answer to this question is related to the correct explanation of the concept of significant figures in general, the properties NSNumberFormatter {uses|minimum|maximum}SignificantDigitshave nothing to do with the accuracy of the calculations.

, , , . , () .

, minimumSignificantDigits maximumSignificantDigits , usesSignificantDigits YES. , , , .

a = 123.4567, b = 1.23 c = 0.00123:

minimumSignificantDigits = 0, 1 2:

maximumSignificantDigits = 3, a "123", b "1.23" c "0.00123".

maximumSignificantDigits = 4, a "123 .5", b "1.23" c "0.00123".

maximumSignificantDigits = 2, a "12 0", b "1,2" c "0.0012".

minimumSignificantDigits = 4:

maximumSignificantDigits = 4, a "123. 5", b "1.23 0" c "0.00123 0".

. 45 - , , 4 a, 5.

+16

All Articles