Forum Discussion

Re: Formula to convert long numbers to short with abbreviation

Here's what I've got so far. [AUM] is the entry field. I made two new fields, one a formula numeric field [AUM (short num)] that only shows 1 decimal:

var number AUMlength = Length(ToText([AUM]));
var number AUMdiv = $AUMlength/3;
var number AUMrem = Rem($AUMlength,3);
var number AUMshortA = [AUM]/10^(Int($AUMdiv)*3);
var number AUMshortB = [AUM]/10^((Int($AUMdiv)-1)*3);

Case($AUMrem,
0, $AUMshortB,
1, $AUMshortA,
2, $AUMshortA)

And the formula text field [AUM (short text)]:

var number AUMlength = Length(ToText([AUM]));

If(
$AUMlength>=7 and $AUMlength<=9, "$" & ToText([AUM (short num)]) & " M",
$AUMlength>=10 and $AUMlength<=12, "$" & ToText([AUM (short num)]) & " B",
$AUMlength>=13 and $AUMlength<=15, "$" & ToText([AUM (short num)]) & " T")

I'll have to give the rounding another think later, but this works so far.

------------------------------
Daniel Johnson
------------------------------
No RepliesBe the first to reply