question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Australian 13-numbers do not get correctly formatted.

See original GitHub issue

In Australia, 13-smart numbers (different from 1300 numbers, as 13-numbers are 6 digits long) do not correctly get formatted using the AsYouType formatter.

According to the Australian style guide (https://www.stylemanual.gov.au/style-rules-and-conventions/numbers-and-measurements/telephone-numbers) 6 digit 13 numbers should be written like this:

13 33 45

Using the AsYouTypeFormatter from the Google Demo, it gets rendered correctly.

Using libphonenumber-js, it gets rendered as

133345

Google’s demo link

https://libphonenumber.appspot.com/phonenumberparser?number=134578&country=AU

Screen Shot 2021-05-26 at 4 07 33 pm Screen Shot 2021-05-26 at 4 07 22 pm Screen Shot 2021-05-26 at 4 07 40 pm

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ccg-timcommented, May 27, 2021

No worries, happy to help 😃

This is not a number without an area code. Similar to the 1300 number (https://libphonenumber.appspot.com/phonenumberparser?number=1300555444&country=AU) which does get formatted correctly, the 13 number works in all areas of Australia.

Here is an Aussie ad for good measure 😃 https://www.youtube.com/watch?v=Y0HchzE-7rM

2reactions
ccg-timcommented, May 26, 2021

Note, this has already been reported on issue #297, however, it is important to note that the number format that was shown was for Premium rate SMS - but this issue is not a premium rate SMS number. As shown in the screenshot, it is a SHARED_COST number, similar to 1300-numbers.

Smartnumbers® are 13, 1300 or 1800 telephone numbers. Smartnumbers® include phonewords like 13 CATS (13 2287) and distinctive patterned numbers such as 1300 222 222.

https://www.thenumberingsystem.com.au/

Smartnumbers are catchy numbers. They might:

  • be in a pattern, such as 1300 456 789
  • have double digits, such as 1300 222 222

https://www.acma.gov.au/buy-custom-number

https://github.com/google/libphonenumber/blob/c6277266fba8223cfc610cfb1e999deb9f876d65/resources/PhoneNumberMetadata.xml#L2528-L2541

      <!-- Local-rate (SmartNumbers) are put here because they are a reverse-charge network,
           although they charge a small local call connect fee (around 25c). These start with 13
           or 1300. -->
      <sharedCost>
        <possibleLengths national="6,8,10"/>
        <exampleNumber>1300123456</exampleNumber>
        <nationalNumberPattern>
          13(?:
            00\d{3}|
            45[0-4]
          )\d{3}|
          13\d{4}
        </nationalNumberPattern>
      </sharedCost>

https://github.com/google/libphonenumber/blob/c6277266fba8223cfc610cfb1e999deb9f876d65/resources/PhoneNumberMetadata.xml#L2335-L2340

          <!-- 6-digit variable cost fixed line (toll free, premium rate, shared cost) -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>13</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Please format your Aussie phone numbers correctly!
Use this format when giving Australian telephone numbers for use outside Australia. Start with a plus sign ('+') and add the country code....
Read more >
Telephone numbers - Style Manual
Australian telephone numbers in general use have no more than 10 digits: ... don't have 10 digits – for example, '13' numbers have...
Read more >
Telephone numbers in Australia - Wikipedia
Mobile numbers are written in the form of ten digits in length, when dialed within Australia, the 0 must be included, plus 4,...
Read more >
13 numbers | How to get a 13 number for your business
13 Numbers are a fantastic tool for businesses to use in marketing as there are only 4 digits after the prefix. Some great...
Read more >
Some people don't know how to write phone numbers.
The classic Australian example is writing a telephone number in international format incorrectly, so you will often see something like (02) 5550 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found