Thousands Conversion (MK)

Thousands Conversion (MK)

Top  Previous  Next

 

The thousands conversion code converts an integer numeric value to a rounded thousands form. It behaves identically when used as an input or output conversion.

 

The full format of this conversion code is

 

MK{n}

 

where

 

nspecifies the width of the result and defaults to 3 if omitted.

 

 

The MK conversion code constrains an integer value to a given width, rounding to a number of thousands, millions or billions using suffixes of K, M or G respectively if needed. If the data cannot be represented in the requested width, an asterisk is returned.

 

 

Examples

 

Value

MK3

MK4

MK6

1

1

1

1

12

12

12

12

123

123

123

123

1234

1K

1234

1234

12345

12K

12K

12345

123456

*

123K

123456

1234567

1M

1M

1235K

12345678

12M

12M

123346K

123456789

*

123M

123M

1234567890

1G

1G

1235M

12345678901

12G

12G

12346M

123456789012

*

123G

123G

1234567890123

*

*

1235G

12345678901234

*

*

12346G

999000

1M

999K

999000