A word for converting numbers to (number / 1000) + K [duplicate]

Is there a word for the case where a number has been converted to something with a trailing ‘K’ (and possibly ‘M’ for millions, ‘B’ for billions, ...)?

Example: 250,000 changes to 250K

It will be used in a sentence like “The number is ...”, like hyphenated and capitalized are used in “The word is hyphenated” and “The character is capitalized”.


Context: I’m programming a set of functions to deal with character and number formatting. For most of those functions, the name is simple and obvious: uppercase(), round() and trim(). Until now, I’ve used number_shorten(), which is not very descriptive, and someone reading my code would have to guess what it actually does, and therefore I’m looking for a better word to describe my function.


Solution 1:

In computing circles, we often refer to numbers like 10K, 24M, 120G as being human-readable or humanized numbers. This is often in the context of byte counts, which can get notoriously unwieldy with modern storage sizes (e.g. saying I have 323416563175 bytes free on my computer), though I have seen it applied to other contexts as well.

For example, the man page for the df utility contains this description:

 -H      "Human-readable" output.  Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte,
         Terabyte and Petabyte in order to reduce the number of digits to three or less using
         base 10 for sizes.

There are entire packages designed to produce human-readable output, such as the humanize Python package.

Solution 2:

I don't believe there is a specific term which applies only to numbers, but we can say such numbers are abbreviated.

For example, the University of North Carolina says of such numeric suffixes:

K: an informal abbreviation for one thousand used in expressions where the unit is understood, such as "10K run" (10 kilometers) or "700K disk" (700 kilobytes or kibibytes).

M: informal abbreviation for million in expressions where the base unit is understood, as in "500M hard drive" (500 megabytes or mebibytes).

And, if "K" and "M" are abbreviations, then numbers expressed with them have been abbreviated.

Solution 3:

As you can see, none of the suggested terms, however good from the language point of view, would be self-describing and hence not suitable for an identifier, which is your use case.

As a programmer, I would stick to using a self-describing identifier, such as

convertToK()
convertToThousands()
convertToKilo()
toKilo()
toThousands()

So

The number is converted-to-thousands :)

You may read e.g. the Tim Ottinger's Rules for Variable and Class Naming, where the author recommends (among others):

  • Use Intention-revealing Names
  • Make Meaningful Distinctions

As you clearly stated that the domain of your word search is programming, then you probably should not ask the linguists :) Think as a client of your code - will they have to open the documentation to know what your method does or will they be able to understand it without doc?


N.B. You should also make clear (at least in your doc) what exactly you mean by K/M/G. Based on your example

250,000 changes to 250K

it looks that you mean just plain multiplies by 1,000. Although it is technically correct, for many programmers it might be misunderstood as they might expect binary multipliers (1024, 1048576, 1073741824) instead of decimal multipliers (1000, 1000000, 1000000000).

Solution 4:

250k is a shorthand representation of 250,000. In terms of code, a function could reasonably be called something like displayShorthand()

Solution 5:

I suggest "denominate" for "express in units of".

denominate: (verb) to express or designate in some denomination

(noun) a number that specifies a quantity in terms of a unit (of measurement)

denomination: a value or size of a series of values or sizes (as of money)

Here, the value, rather than being a unit of measurement, is a pure dimensionless quantity; in other words the K or M parameter is the denominator.

Related, and also worth considering, is @keshlam's suggestion in the comments, to "rescale" (or simply "scale") the quantity:

rescale: Alter the scale of (a quantity), typically to make it smaller or simpler.

scale: To make in accord with a particular proportion or scale or To alter according to a standard or by degrees; adjust in calculated amounts.