21

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.

Honza Zidek
  • 4,025
  • 1
    contracted? (I can't say that it's appropriate. I just would understand its usage in this context.) – SrJoven Aug 25 '14 at 11:59
  • Hey Josh - nice find but it's nothing like a dupe. That person is just asking whether to use M or K. – Fattie Aug 25 '14 at 12:08
  • 2
    It also says they are called numeric abbreviations. –  Aug 25 '14 at 12:09
  • @JeffreyRoosendall Since you're looking for a function name, can I suggest you check out some open source number formatting libraries, and see what they've used? Maybe printf from the POSIX standard is a good place to start. – Dan Bron Aug 25 '14 at 13:04
  • @DanBron That's a great idea, thanks, I'll take a look. – Jeffrey Roosendaal Aug 25 '14 at 13:08
  • 1
    @JeffreyRoosendaal I got a little excited for a when I remembered the word "decimate", which I believed meant "reduce to a tenth"; unfortunately, it actually means "reduce by a tenth" (i.e. take down to 90%). But if "decimate" had meant "reduce to 10%", you could've used "millesimate" (or maybe "millesimamate"?) for K-ifying a number, and (at a stretch) "milionesimate" for M-ifying, and some kind of play on "*denominate*" for the generic "reduce by a factor of or express in units of N". – Dan Bron Aug 25 '14 at 13:36
  • You seem to be converting to metric, essentially. So maybe something like toMetric() would be good. I'm not offering this as an answer because it's not actually a single English word. – trlkly Aug 25 '14 at 13:53
  • 3
    I'd say you were rescaling the number. – keshlam Aug 25 '14 at 16:36
  • @DanBron Decimate does not mean either of those things, it means reduce to whatever level you wish nominally by counting off by tens and discarding each tenth item. I guess the idea is that counting off by a number as high as ten was complex enough to keep the person doing the counting-off from cheating. – Jon Jay Obermark Aug 26 '14 at 01:39
  • FYI, after M (Mega) it's not B but G (Giga) - the classic Back to the Future "1.21 Gigawatts!" quote. And after that it's T (Tera). – slebetman Aug 26 '14 at 04:44
  • @trlkly: toSI would be better because metric implies you're converting units. It's perfectly fine to have 1k yards. – slebetman Aug 26 '14 at 04:45
  • 1
    @slebetman: That depends on the context of the program, whether the end-user of the software expects "Million" and "Billion", (but then wouldn't it be T for "Thousand", rather than K?). – jxh Aug 26 '14 at 08:21
  • Assuming you wanted Kilo, Mega, and Giga, you could simply name your function "KMGify_number". K, M, and G are usually reserved for powers of 1024. If you really intend powers of 1000, KMB is probably better, as K is 1000 in SI. – jxh Aug 26 '14 at 08:27
  • The intention is to use it for metrics: 20K downloads, 1,5M visitors, etc. In that context K, M, B are the correct (and expected) suffixes. (I'm a little surprised I haven't seen any answers around the word suffix actually) – Jeffrey Roosendaal Aug 26 '14 at 08:45
  • @jwpat7's answer mentions "suffix". – jxh Aug 26 '14 at 09:16
  • @Jon: Deci-mate, from the Latin for 1/10, was originally a punishment for mutinous (or otherwise criminal) troops. It meant one in ten men in the unit was going to be killed (selected by lots). That is, the troop was reduced to 90% strength (but presumably better behaved :). The word comes from the Latin for "removal of one tenth". – Dan Bron Aug 26 '14 at 09:58
  • HILARIOUS -- again we see an awesome example of "insane voting on ELU". Two people voted to close this. It is, obviously, one of the best questions ever see on here. It has identified a (absolutely clear) and fascinating linguistic trend, and is asking about it. – Fattie Aug 26 '14 at 10:13
  • @JoeBlow It's probably because it appears to be more of a programming question. So I'll point out that, while it does mention programming, it is asking about language. It would be closed on Stack Overflow for being opinion based. – trlkly Aug 26 '14 at 15:58
  • @DanBron If someone today says a population has been decimated, it has been reduced by far more than 10%. It has been affected by depletion over and over again to the point where it is largely gone. Later sailors kept the word, but performed a practice that affected any arbitrary degree of reduction. As often in English, the actual meaning has very little to do with the etymology. – Jon Jay Obermark Aug 26 '14 at 19:02
  • @Jon, it's not worth arguing about when we can just refer to a dictionary and settle the discussion. The first three definitions from the OED are literally: "1. To exact a tenth* or a tithe from; to tax to the amount of one-tenth.", "2. To divide into tenths, divide decimally.", and (unsurprisingly) "Mil. To select by lot and put to death one in every ten of (a body of soldiers guilty of mutiny or other crime): a practice in the ancient Roman army, sometimes followed in later times.*". Yes, there are more senses, incl. some that follow your usage, but 1/10 is the original. – Dan Bron Aug 26 '14 at 19:09
  • @DanBron Choose a dictionary that does not put nearly-obsolete definitions first. The OED is seldom a good reference to modern usage. 'My usage' is what modern journalists mean when they say the phrase, every time, unless they are discussing history. I have seldom heard it used outside journalism. – Jon Jay Obermark Aug 26 '14 at 19:11
  • @Jon, Thank you for sharing your personal experiences and opinion of the OED. – Dan Bron Aug 26 '14 at 19:13
  • 1
    The OED by policy puts first references first, and does not attempt to order meanings by how commonly they are used. It is therefore not intended as a policy of its authors for the use to which you have put it. This is not simply my own personal experience and opinion. Know what references to use for what purposes, or just don't whip out references. – Jon Jay Obermark Aug 26 '14 at 19:15
  • I know the OED's policy and layout, and the "personal experiences" I referred to was your statement "I have seldom heard it used outside journalism". The word decimate does mean "reduce by 1/10th", whether you like it or not, whether you've heard it or not, and whether it has other meanings or not. That is the purpose of having dictionaries, and on this site the OED is considered the most fundamental reference. Nevertheless, I am confident any dictionary you choose to reference will have the sense of 1/10 included among the definitions of "decimate", because that's what it means. – Dan Bron Aug 26 '14 at 19:18
  • 1
    Right and girl means any young child that has not yet developed muscles. Because that is its oldest definition. Whether or not anyone uses it that way. – Jon Jay Obermark Aug 26 '14 at 20:46
  • http://www.merriam-webster.com/dictionary/decimate http://dictionary.reference.com/browse/decimate?s=t

    So one of these suppresses that meaning as secondary and the other marks it as obsolete. So they include it, but they pretty much insist that this is unlikely to be what it means.

    – Jon Jay Obermark Aug 26 '14 at 20:49
  • @Jon, I think you don't understand how dictionaries work (for a start, they don't "suppress" meanings; that's pretty much the antithesis of their goal). And "girl" meaning "female human with undeveloped muscles" (in other words, prepubescent woman) is the most common usage. But that's all irrelevant: decimate does mean reduce by 1/10th, literally by definition. If there are other definitions, great, that doesn't invalidate that one. I am pleased to have taught you something. – Dan Bron Aug 26 '14 at 20:59
  • The point is that the oldest meaning of girl does not specify female. That definition is obsolete. Obsolete definitions are no longer definitions, and at least one reputable lexicographer considers your meaning so unlikely they have labeled it obsolete. OK so suppress is not the best word for this process of downgrading something to marginal status, but you understood what I meant. – Jon Jay Obermark Aug 26 '14 at 21:05
  • The "oldest definition" of girl does not, in fact, specify female: it specifies "sexually immature female". Which I suppose everyone would agree is incomprehensible and meaningless. Or not. And I suggest you look up the definition of "definition" if you think it means "not a definition" (personally, I'd be inclined to say "to increase, expand, and make happy" is not a definition of "decimate", rather than definitions of the word which literally appear in the dictionary), but I'm not here to teach you English, unless you would like to ask a question about dictionaries. – Dan Bron Aug 26 '14 at 21:14
  • 1
    http://www.etymonline.com/index.php?term=girl

    So 'girl' first appears in English ungendered.

    – Jon Jay Obermark Aug 26 '14 at 22:44
  • 1
    @DanBron You mention decimation (shooting one soldier in ten) as being 'a practice of the ancient Roman army, sometimes followed in more recent times'. It was actually practised as recently as by the Italian army fighting on the Allied side in the First World War. A defeat in battle would lead to executions. – WS2 Aug 26 '14 at 23:11
  • 1
    surely everyone interested in words knows that "decimate" originally meant, simply, kill one soldier in ten. You know, in the popular I am number four books, the authors infuriatingly consistently use decimate the "wrong" way, in the typical modern use of "really destroy" - it drives me nuts! Heh! – Fattie Aug 27 '14 at 11:37
  • Jeffrey, it is INCREDIBLY ANNOYING that you only later mentioned you were looking for an in-code identifier! ouch! i love in-code related questions, but everyone put time in to answering this as a language question. – Fattie Aug 27 '14 at 11:39
  • @JoeBlow Initially I never realized it was important to put this into that context. I just expected a common word (verb) which I simply 'did not think about'. Only after seeing all kind of answers, I knew it did matter. Lesson learned, this is only my second question here, next time I'll give the context right away. – Jeffrey Roosendaal Aug 27 '14 at 19:12
  • 1
    This question appears to be off-topic because it is about naming things in code, which is off-topic per site policy. – Mr. Shiny and New 安宇 Aug 27 '14 at 21:37
  • Although, almost everyone here seems to be a programmer and we love "what to name this routine!" questions!! :) – Fattie Aug 28 '14 at 07:56

12 Answers12

31

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.

nneonneo
  • 780
  • 3
    This is much better than many others, because this is the existing terminology for this operation. – AJMansfield Aug 26 '14 at 01:29
  • 2
    The reason it is "human-readable" is because 24M is more easily understood by a human than 25165824. The reason it isn't 25M is because the software is actually reducing the value by units of 1024 (the traditional unit value for 1K is 2^10 in computing circles, as you may well know). – jxh Aug 26 '14 at 06:35
  • @jxh: Many programs now allow the option of using base-1000 units (as the -H flag here does), or traditional base-1024 units (as df's -h flag will do). Part of this "new" trend seems to be the fact that some OSes (like OS X) have switched to reporting all sizes using base-1000 units. – nneonneo Aug 26 '14 at 14:28
  • 1
    @nneonneo : don't blame Apple for it ... MacOS is actually pretty good about reporting 'MiB' vs. 'MB' (Mebibytes vs. Megabytes; 10^6 vs. 2^20). The problem came from hard drive manufacturers trying to make their drives sound more impressive (2TB = 1.82TiB) – Joe Aug 26 '14 at 23:12
23

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.

Mou某
  • 5,377
  • 1
    +1; let me do some editing to see if I can convince the downvoter to reconsider. – Dan Bron Aug 25 '14 at 12:25
  • 1
    Good suggestion. However while certainly being an abbreviation, It's not just an abbreviation. But I'm going to use this term until something more specific comes along. Thanks. – Jeffrey Roosendaal Aug 25 '14 at 13:00
  • 1
    of course it's an "abbreviation" - the whole point of the question is, what's a word for this type of abbreviation? – Fattie Aug 26 '14 at 10:10
10

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).

Honza Zidek
  • 4,025
  • Thanks for pointing out I'm looking for an identifier. You're right, however sometimes the number should get a trailing M or B, for the input is variable. Also, to be a little more precise, I'm creating an AngularJS filter (like date, currency, format, ...) – Jeffrey Roosendaal Aug 25 '14 at 13:14
  • If the OP is looking for terms to use in computer code, I utterly agree with you, totally, Honza. But I believe the OP is looking for a natty slang word, used for this phenomenon. – Fattie Aug 26 '14 at 10:11
  • Joe, the OP clearly states in the Context part of his post that he's programming and is looking for an identifier. – Honza Zidek Aug 26 '14 at 11:08
6

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

mowwwalker
  • 1,203
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.

Dan Bron
  • 28,335
  • 17
  • 99
  • 138
  • 2
    The assigning of names to functions is a specialist use of English where distinctive, unambiguous, and mnemonic naming is often more important than formality and correctness. The main role of such a name is that it be easy to recall when seen and newly required. I believe there is no such single word, but "denominadte" would be a good candidate. – Dan Aug 25 '14 at 14:32
  • @DanSheppard, denominadte isn't easy to recall because it isn't pronouncable and looks like a misspelling. – James Waldby - jwpat7 Aug 26 '14 at 17:44
  • @jwoat7, I believe it *was* a misspelling. – Dan Bron Aug 26 '14 at 17:48
  • We're expressing a number in some other base unit. Instead of "express in units of" let's call it "unitize". – kmort Aug 26 '14 at 21:03
  • 1
    This answer is the most expressive of the assumed intent: the quantification in comprehensive units. – Z Douglas Sep 02 '14 at 18:21
3

Honza Zidek's suggestion, toKilo(), is simple and clear. If your procedure only substitutes K in place of the last three digits of a decimal number, that's probably best.

However, if it can substitute other suffixes (eg K, M, B for 3, 6, or 9 digits), consider toKMB(), or perhaps affixKMB(), using affix as verb that's more descriptive than to. From wiktionary, affix has a sense “To subjoin, annex, or add at the close or end; to append to” which is relevant in this context. Also consider appendKMB().

If in addition you have procedures that can add SI prefixes, then toKilo() causes ambiguity; more explicit names like subSIprefix() and subSIsuffix() might be desirable.

  • Nice solution, although I would prefer affix. The word append has a fixed meaning in programming languages and usually means just appending the given thing to the end of the original one without changing the original one. Here the OP means to change the original number - divide by 1,000 or 1,000,000 etc. Affix does not have this strong meaning for a programmer. If a method called append() changed the original object, I would be angry as a client of the method. – Honza Zidek Aug 26 '14 at 09:30
  • If the OP is looking for terms to use in computer code, I utterly agree with you, totally, jwpat. But I believe the OP is looking for a natty slang word, used for this phenomenon. – Fattie Aug 26 '14 at 10:11
  • In the SI system kilo- etc are referred to as prefixes (and the prefix for *1024 is kibi). Prefix is of course available as a verb but a function name would need to be slightly more descriptive. – Chris H Aug 27 '14 at 21:26
2

Because the abbreviations are based on thousands, you might be able to derive something from K-notation (like scientific notation, but with thousands instead of powers of 10). Even though the letters change, they are based on K-groups. You could use K-reduce, for instance, although you'd have to write it to remove the hyphen.

Kit Z. Fox
  • 27,819
2

This process is related to the math activity known as factoring, for example:

3 x + 21 = 3(x + 7)

So, you could say that the following is factoring by K:

250,000 = 250K

jxh
  • 10,463
2

Engineering Notation refers to a format that is similar to scientific notation, with the restriction that the power of ten used must be a multiple of three. With this restriction in place, it is easy to refer to the quantity using a metric prefix.

A couple of examples:

0.0000157 Amps = 15.7 × 10-6 = 15.7 μA

12600 Volts           = 12.6 × 10 = 12.6 kV

http://en.wikipedia.org/wiki/Engineering_notation

The Wikipedia site links to some Perl Code that implements this functionality.

So, perhaps, ToEngineeringFormat() or something similar would work.

B Pete
  • 139
1

(Note: this replaces my deleted answer which was posted half-baked last night from my phone before I ran out of time to finish it)

In the SI system kilo- etc are referred to as prefixes (and the IEC prefix for *1024 is kibi, to avoid confusion between 2^10 and 10^3, though isn't widely used).

Prefix is of course available as a verb but a function name would need to be slightly more descriptive. Of course this prefix is a prefix to a unit, not to the value, so prefix_number() wouldn't make much logical sense. I guess generate_unit_prefix() is too long. In a sense you're appending to (discussed and dismissed above for good reasons) or postfixing/suffixing the number, but that wouldn't help the next maintainer of the code, and suffers the logical flaw that the number itself is actually modified.

Humanise was suggested, and is close enough to get my vote, but if you look at the docs for (e.g.) the Python package it's not a good fit (though some GNU tools may use the terms more in this sense, the docs I've read prefer the adjective human-readable).

The output of such a function is almost bound to be a string in many languages, while the input may be but is more likely to be a numeric data type. By analogy with toString(), I propose something along the lines of toReadableString() or toHumanString() to pair with made human-readable in prose use.

Chris H
  • 21,709
0

roundNumberWithMetricSymbol()

By coding standards the more descriptive you are the better as you have quite rightly pointed out.

The reason for using "MetricSymbol" that what you are describing is actually the correct term for the unit of measurement.

http://en.wikipedia.org/wiki/Metric_system

Dave
  • 11
  • While the SI system is certainly "metric", the convention to use multipliers is by no means constrained to the metric system; indeed, kilodollars and kilobytes are not metric units at all. – tripleee Aug 26 '14 at 16:52
-1

What a great question! I think you're ahead of the curve on word-generation. I believe there is no such term. If there was I'd use it all the time.


Traditionally with single-word-requests, if the answer is "there is no such word", posters make suggestions for new slang for the issue at hand. Here we go...

"S.I.-ized"

"k-isation"

"dot-com numbers"

Factoids: people in "the valley" (silicon valley) often refer to "kpa" or "k/pa" as in 390 kpa (salary, $390,000 per annum); this project's only brining in 20 kpa, etc.

So, if this came up in literature, one could perhaps use a phrase like "she always gave thousands using a 'K', like everyone else in Silicon Valley or Berlin ..."

Or, "She always said dot-com-numbers, like twenty 'K' instead of twenty thousand..."

Or for example, "Like every dreamer in silicon valley, she k'ized every number she mentioned, like twenty K or two hundred K, or if it was some particularly big dream, 800 K..."

Again - IMO there is, as yet, no current term for this really socially decisive phenomenon you raise, Jeffrey.

Fattie
  • 10,520
  • There is a term and anyone who've spent enough time designing user interfaces knows it: "human readable" or the colloquial "humanized". It's called human readable because if you ask the computer about the size of a file it will return something like 4352004350 and it takes time to count the number of digits whereas 4.3G directly tells you it's 4.3 Gigabytes. – slebetman Aug 26 '14 at 04:42
  • (@slebetman (1) nneonneo already posted this answer (2) phrases like "anyone who've spent enough time designing user interfaces" (presumably "who's") sound pretentious. if you want to go through life sounding pretentious and arrogant, go for it. You should be aware that, there are many people on here who have vast, notable, careers in software.) – Fattie Aug 26 '14 at 10:16
  • Another awesome ELU VOTING MOMENT. This is the only correct answer here ("I believe there is no such term") and it has two downvotes - proving it is correct in the ELU metaverse. – Fattie Aug 26 '14 at 10:17
  • I think you are making things more complicated than they need to be. No, there isn't a word for meaning exactly what the op asks. However, in the original question, he gives the example, "The number is..." similar to "The word is (capitalized)" Taking from some of the other answers: Abbreviated, Humanized, Denominated, Scaled, Factored are all suggested words that could possibly fit. I disagree with saying there is "no current term", because the more-general words fit just fine. (Just attempting to explain the opposite viewpoint, Your answer is valid imo, just in a different direction) – DoubleDouble Aug 26 '14 at 20:55
  • I can't seem to find anything on the Internet using "dot com numbers". Is that a phrase localized to some place? – corsiKa Aug 26 '14 at 22:22
  • Hi cors - no, as I said, I was making suggestions. (the usual thing on single-word questions where the answer is "there is no word!") – Fattie Aug 27 '14 at 11:33