定制 jitup1/amountinwords 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jitup1/amountinwords

最新稳定版本:1.1.2

Composer 安装命令:

composer require jitup1/amountinwords

包简介

A package to convert amount into words

README 文档

README

Installation

You can install the package via Composer. Run the following command in your Laravel project's root directory:

composer require jitup1/amountinwords

Usage
'providers' => [
    // Other Service Providers

    jitup1\amountinwords\AmountinwordsServiceProvider::class,
],



<?php

namespace App\Http\Controllers;

use jitup1\amountinwords\PrintAmountInWords;

class AmountController extends Controller
{
    protected $amountInWords;

    public function __construct(PrintAmountInWords $amountInWords)
    {
        $this->amountInWords = $amountInWords;
    }

    public function index()
    {
        $amount = 12345; // Example amount
        $words = $this->amountInWords->displayWords($amount);

        return response()->json([
            'amount' => $amount,
            'in_words' => $words,
        ]);
    }
}
Step 3: Create a Route
You can create a route to access the controller in your routes/web.php (or routes/api.php) file:

use App\Http\Controllers\AmountController;

Route::get('/amount-in-words', [AmountController::class, 'index']);

Usage
   $amount = 4000.00; // Example amount
    // Call the correct method to convert amount to words with currency names
    $words = $this->amountInWords->amountToWords($amount, 'USD', 'cents');

    return response()->json([
        'amount' => $amount,
        'in_words' => $words,


Author
jitup123
Email: patel.jitendra.jitu@gmail.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-25