phpuef/currency 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpuef/currency

最新稳定版本:v1.1.0

Composer 安装命令:

composer require phpuef/currency

包简介

README 文档

README

Currency

The currency package provides functionality to manage and validate different currency codes and their details. It contains a list of currency codes with information such as the name, symbol, and minor units (decimal places). You can use this package to retrieve currency information and validate whether a currency code exists. (ISO 4217)

Static Badge

Packagist Downloads GitHub stars PHPStan Tests codecov

Versions

Stable Version GitHub Release GitHub Release

Also available in other languages

Go Implementation PHP Implementation

Features

  • Search for a currency by its code (e.g., USD, EUR).
  • Validate if a currency code exists.
  • Return detailed information such as currency name, symbol, and minor units.

Installation

composer require gouef/currency

Usages

Finding a currency

You can use the FindCurrency function to search for a currency by its code. It returns a pointer to the Currency object, which contains details like the name, symbol, and minor units.

<?php

use Phpuef\Currency\Currencies;

class Example {

    public function get(string $code) {
        $currency = Currencies::FindCurrency($code);
        //
    }

}

Validating a Currency Code

To check whether a currency code is valid, use the ValidateCurrency function. It returns true if the code exists and false otherwise.

<?php

use Phpuef\Currency\Currencies;

class Example {

    public function validate(string $code): bool {
        return Currencies::ValidateCurrency($code);
    }

}

Contributing

Read Contributing

Contributors

JanGalek actions-user

Join our Discord Community! 🎉

Discord

Click above to join our community on Discord!

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-18