If you'd like to use the Numeric Shorthand in your MapBasic applications, I have created a function for this in the STRINGLib module of the MapBasic Common Libraries.
The function looks like this:
'**********************************************************************************************''
'Created by Peter Horsbøll Møller, Precisely
'Parameters:
' :
'Return value:
'
'**********************************************************************************************''
Function STRINGNumericShorthand( ByVal fValue As Float 'Value to show as "1K", "50M", and similar
, ByVal fRoundTo As Float 'Controls how to round the shortened number. If > 1, no decimals. Similar to the form used in Round.
) As String
Dim nSign As Integer,
fDivisor, fCompact As Float,
sSuffix As String
OnError GoTo ErrorOccured
' Examples:
' STRINGNumericShorthand(1534, 0.1) -> "1.5K"
' STRINGNumericShorthand(1250000, 0.01)-> "1.25M"
' STRINGNumericShorthand(-2000000000, 1)-> "-2B"
' STRINGNumericShorthand(999, 1) -> "999"
' STRINGNumericShorthand(1000000000000, 1)-> "1T"
' Sign management
If fValue < 0 Then
nSign = -1
fValue = Abs(fValue)
Else
nSign = 1
End If
' Choose scale and suffix (short scale)
If fValue >= 1000000000000 Then 'trillions / 1e12
fDivisor = 1000000000000
sSuffix = "T"
ElseIf fValue >= 1000000000 Then 'billions / 1e9
fDivisor = 1000000000
sSuffix = "B"
ElseIf fValue >= 1000000 Then 'millions / 1e6
fDivisor = 1000000
sSuffix = "M"
ElseIf fValue >= 1000 Then 'thousands / 1e3
fDivisor = 1000
sSuffix = "K"
Else
fDivisor = 1
sSuffix = ""
End If
fCompact = fValue / fDivisor
' Optional threshold bump: avoid outputs like 1000K -> show 1M
If Round(fCompact, fRoundTo) >= 1000 Then
Do Case sSuffix
Case ""
fCompact = fCompact / 1000
sSuffix = "K"
Case "K"
fCompact = fCompact / 1000
sSuffix = "M"
Case "M"
fCompact = fCompact / 1000
sSuffix = "B"
Case "B"
fCompact = fCompact / 1000
sSuffix = "T"
End Case
End If
STRINGNumericShorthand = FormatNumber$(Round((nSign * fCompact), fRoundTo)) + sSuffix
Exit Function
'-------------------------
ErrorOccured:
Call ERRCreate(Err(), Error$(), "STRINGNumericShorthand")
Call ERRPrint()
End Function
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 12-15-2025 09:13
From: Peter Møller
Subject: MapInfo Monday: Labelling Large Numbers
I used MapInfo Pro in combination with Snowflake to aggregate business points into hexagons. I aggregated the count of businesses in each hexagon and also summarized the sales in each hexagon.
You can, of course, create a thematic map, helping you to understand the sales across the area. I decided to label the sales amount on top of the hexagons.
As you can see above, with overlap set to allow overlap, it is a bit hard to make sense of these numbers.
What can you do to be able to better read the important/buíggest numbers?
We'll investigate a couple of approaches in this article. Happy #MapInfoMonday!
Instead of showing every value, you can write a label expression that ignores the smaller values and only displays the values over 1000:
IIf(SALES_sum>1000, Round(SALES_sum, 1), "")
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------