php-language-extensions
Attributes to define PHP language extensions (to be enforced by static analysis) (by DaveLiddament)
Brick\Math
Arbitrary-precision arithmetic library for PHP (by brick)
php-language-extensions | Brick\Math | |
---|---|---|
1 | 11 | |
120 | 1,755 | |
- | 1.9% | |
4.2 | 7.1 | |
2 months ago | 17 days ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
php-language-extensions
Posts with mentions or reviews of php-language-extensions.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-10-18.
-
PHP libraries and tools
dave-liddament/php-language-extensions: Attributes to define PHP language extensions (to be enforced by static analysis)
Brick\Math
Posts with mentions or reviews of Brick\Math.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-10-18.
-
PHP libraries and tools
brick/math: Arbitrary-precision arithmetic library for PHP
-
PHP is trolling me
Use strings. For PHP specifically, the Brick/Math library.
-
[ELI5] Why is it bad to compare floats directly for equality?
There are excellent wrappers for this like https://github.com/brick/math
-
Need Guidance for my Passionate Ecommerce Project
https://github.com/brick/math to handle bignumber and operations
-
How are you handling your money?
In Java and Ruby, BigDecimal is an inbuilt class that can be used. For PHP, you can checkout the Brick Math Library Basically, just find the arbitrary-precision Decimal type/Class/Library in your choice of language. Got another approach, please do let me know in comment section.
- Weekly "ask anything" thread
-
What are the latest thoughts on storing and working with very large and very small financial transactions?
I decided to use https://github.com/brick/math and store the amount as a string in the database. My project use NANO, so that's 30 decimal points to keep. Number type column is not the choice at all.
-
Vote for enums in PHP 8.1 has started — looking good so far!
There are many use cases where enums don't need to be backed by a scalar. I'm thinking of brick/math's RoundingMode for example: you use these in code, but never store/serialize them really.
-
(int) (round(19.33, 2) * 100) = 1932 - can someone please explain this to me?
Besides, using an arbitrary-precision library gives you an unlimited number of digits, and, in the case of brick/math, many more rounding modes to choose from. And predictable ones.
What are some alternatives?
When comparing php-language-extensions and Brick\Math you can also consider the following projects:
Money - PHP implementation of Fowler's Money pattern.
decimal-object - Decimal handling as value object instead of plain strings.
Psalm - A static analysis tool for finding errors in PHP applications
BigNum-PHP - BigNum library for PHP compatible with bn.js
psl - 📚 PHP Standard Library - a modern, consistent, centralized, well-typed, non-blocking set of APIs for PHP programmers
PHP Parser - A PHP parser written in PHP
GrumPHP - A PHP code-quality tool
Brick\Money - A money and currency library for PHP
date-time - Date and time library for PHP
ip - Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
T-Regx - Simple library for regular expressions in PHP.
php-language-extensions vs Money
Brick\Math vs decimal-object
php-language-extensions vs Psalm
Brick\Math vs BigNum-PHP
php-language-extensions vs psl
Brick\Math vs PHP Parser
php-language-extensions vs GrumPHP
Brick\Math vs Brick\Money
php-language-extensions vs date-time
Brick\Math vs ip
php-language-extensions vs T-Regx
Brick\Math vs Money