Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sorting of IP numbers

Featured Replies

I'm sure that the sorting of IP numbers has been answered many times over, but I've been searching with no luck.

 

I've got a filed that contains IP numbers.. ( 192.168.1.1 and 192.168.1.12)

I've made the filed a text filed as number filed does not view correctly. In doing so the IP do not sort correctly if you I do not enter them with leading 0's.

 

192.168.001.001

192.168.001.012

 

is there away around not using the leading 0's

 

Thanks

 

Here is a custom function (by Theo Ros) that should do what you want: http://www.briandunning.com/cf/279

 

It's basically adding the zeros for you with a custom function so you do not need to do it manually.

/*-------------------------------------------------------
Returns a sortable textual representation of an IPaddress.
To text-sort IP addresses, you will have to reformat the triplets.
Here it is done by adding leading zeros to them.
This will result in textvalues that will sort correctly, for instance
in a portal-sort solution.

Syntax: IPToSortableText ( IPaddress )
Return type: Text

IPToSortableText ( Get ( SystemIPAddress ) ) 
returns ip like "192.168.000.001"

Theo Ros
----------------------------------------------------------*/

Let ( ip = Substitute ( TrimAll ( IPaddress ; True ; 3 ) ; "." ; "¶" ) ;
  Right ( "000" & GetAsNumber ( LeftValues ( ip ; 1 ) ) ; 3 ) & "." &
  Right ( "000" & GetAsNumber ( MiddleValues ( ip ; 2 ; 1 ) ) ; 3 ) & "." &
  Right ( "000" & GetAsNumber ( MiddleValues ( ip ; 3 ; 1 ) ) ; 3 ) & "." &
  Right ( "000" & GetAsNumber ( MiddleValues ( ip ; 4 ; 1 ) ) ; 3 )
)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.