Download the PHP package ralphschindler/calcdown without Composer

On this page you can find all versions of the php package ralphschindler/calcdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package calcdown

# Calcdown **A human-readable calculator DSL for web applications** [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](tests/) [![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](tests/) [![Type Coverage](https://img.shields.io/badge/types-100%25-brightgreen)](phpstan.neon.dist) [![PHP](https://img.shields.io/badge/php-%5E8.2-blue)](composer.json) [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE.md)

Why Calcdown?

Ever wished you could add Numi-style calculations to your web application? Calcdown brings that magic to PHP.

Instead of building complex calculator UIs with buttons and operators, let your users write natural calculations like they would in a notebook:

Perfect for:

Features

โœจ Human-Readable Syntax - Write calculations the way you think
๐Ÿ”ข Unit Conversions - Currency, measurements, and more
๐Ÿ“† Date Arithmetic - Add days, calculate deadlines
๐Ÿ’ฑ Currency Support - USD, EUR, GBP with conversions
๐ŸŽฏ Variable Assignment - Store and reuse values
๐Ÿ“ Order of Operations - Proper PEMDAS/BODMAS handling
๐Ÿ’ฏ 100% Test Coverage - Rock-solid and production-ready

Installation

Quick Start

Expression Examples

Basic Arithmetic

Currency Calculations

Unit Conversions

Date Arithmetic

Variables & Assignment

Percentage Calculations

Complex Expressions

Comments

API Reference

CalcdownParser

parseLine(string $line, array $variables = []): LineEvaluation

Parse and evaluate a single line expression.

Parameters:

Returns: LineEvaluation object with:

parseBlock(string $block): BlockEvaluation

Parse and evaluate multiple lines, maintaining variable context.

Parameters:

Returns: BlockEvaluation object with:

LineEvaluation

BlockEvaluation

Supported Operators

Operator Description Example
+ Addition 5 + 3 โ†’ 8
- Subtraction 10 - 4 โ†’ 6
* or times or x Multiplication 4 * 3 โ†’ 12
/ Division 10 / 2 โ†’ 5
% Modulo 10 % 3 โ†’ 1
^ Exponentiation 2 ^ 3 โ†’ 8
= Assignment x = 5
in Unit conversion 100 cm in m โ†’ 1
of what is Reverse percentage 20% of what is 50 โ†’ 250

Supported Units

Currency

Length

Volume

Time

Percentages

Special Identifiers

Use Cases

1. Invoice Calculator

2. Project Timeline Calculator

3. Unit Conversion Tool

4. Financial Calculator

Error Handling

Currently, Calcdown focuses on parsing valid expressions. Invalid tokens or unrecognized operators are handled gracefully:

Development

Running Tests

Code Quality

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Roadmap

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Inspiration

Calcdown is inspired by Numi, a beautiful calculator app for macOS. While Numi is a desktop application, Calcdown brings similar capabilities to web applications written in PHP.

Acknowledgments


Made with โ˜• and ๐Ÿงฎ [Report Bug](issues) ยท [Request Feature](issues)

All versions of calcdown with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.0
markrogoyski/math-php Version 2.*
php-units-of-measure/php-units-of-measure Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ralphschindler/calcdown contains the following files

Loading the files please wait ...