[3.3][RC] Short Number Twig Extension

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Toxyy
Registered User
Posts: 966
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

[3.3][RC] Short Number Twig Extension

Post by Toxyy »

Extension Name: Short Number Twig Extension
Author: Toxyy

Extension Description: Adds short_number_ext twig function for use in the template. This function converts numbers over 10,000 to their short forms using K for thousand, M for million, B for billion, and T for trillion.
  • 123,123 -> 123K
  • 123,123,123, -> 123M
  • 123,123,123,123 -> 123B
  • 123,123,123,123,123 -> 123T
A language file has been added if K/M/B/T are not used in your language.

Extension Version: 1.0.1

Requirements:
  • phpbb 3.3.x
  • PHP >=7.1.3
Features:
  • Adds short_number_ext twig function for use in the template
Screenshots:
Usage example: {{ short_number_ext(forumrow.POSTS) }} in the forumlist_body.html template file
** This is just an example. You can use this function anywhere in any template file.

Image

Installation:
  • Download the latest release and unzip it.
  • Upload the unzipped files to /ext/toxyy/shortnumbertwig and enable it in the ACP
GitHub Repository: https://github.com/toxyy/shortnumbertwig
Extension Download: https://github.com/toxyy/shortnumbertwi ... v1.0.1.zip
Last edited by Toxyy on Thu Feb 01, 2024 7:32 pm, edited 5 times in total.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
User avatar
warmweer
Jr. Extension Validator
Posts: 11864
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: [3.3][RC] Short Number Twig Extension

Post by warmweer »

Just a small remark.
Billion and Trillion are English terms and in daily language are used in the short scale. Other languages (e.g. Dutch, German also IIRC) use long scale
I would recommend adding a note to the extension explaining that (especially if it is used with other languages).
see https://en.wikipedia.org/wiki/Metric_prefix
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [3.3][RC] Short Number Twig Extension

Post by david63 »

I would also point out that if this extension is for phpBB 3.3.x then the PHP version must be at least 7.1.3
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
Toxyy
Registered User
Posts: 966
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek

Re: [3.3][RC] Short Number Twig Extension

Post by Toxyy »

warmweer wrote: Mon Aug 31, 2020 12:36 pm Just a small remark.
Billion and Trillion are English terms and in daily language are used in the short scale.
Language file added now :)
david63 wrote: Mon Aug 31, 2020 12:50 pm I would also point out that if this extension is for phpBB 3.3.x then the PHP version must be at least 7.1.3
Changed.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
User avatar
DTMWC
Registered User
Posts: 379
Joined: Tue Jan 16, 2018 6:17 am

Re: [3.3][RC] Short Number Twig Extension

Post by DTMWC »

Nice idea :-)
Boom.

Return to “Extensions in Development”