Git Product home page Git Product logo

Comments (11)

hooman-mirghasemi avatar hooman-mirghasemi commented on August 24, 2024 2

#110

from multipay.

hooman-mirghasemi avatar hooman-mirghasemi commented on August 24, 2024 1

نه دوست عزیز من تازه عضو نشدم اگرم فارسی تایپ میکنم صرفا به خاطر اینکه همزبان هستیم. اما ایشیو هایی که برای این ریپازتوری یا ریپوی لاراول مطرح شده مدت زمان زیادی شده که بسته نشدن. همچنین آخرین کامیت ها مربوط میشه به حداق دو ماه پیش.
گفتم شاید دیگه خیلی با انرژی قبلی پیگیری نمیشن این ریپازتوری ها.

و اینکه من واقعا نفهمیدم چرا نباید از اعداد اعشاری استفاده کرد . خوب من درگاه خودم رو میخوام بنویسیم
یا از درگاه یک پی که شما تو ریپازتوریتون هست که مبلغ رو به یورو میگره استفاده کنم. چی کار باید کنم ؟ تنها کاری که الان تونستم کنم این بوده که یه کلاس invoice
دیگه ساختم که از کلاس شما ارث برده و متد
amount
رو باز نویسی کردم که کار کنه!

from multipay.

khanzadimahdi avatar khanzadimahdi commented on August 24, 2024

what kind of currencies do you use? current gateways, all have fixed length amount (integer).

from multipay.

parsagholipour avatar parsagholipour commented on August 24, 2024

We are developing a project which has a floating point number currency. I had the idea of using this package for the project and make the driver.

from multipay.

khanzadimahdi avatar khanzadimahdi commented on August 24, 2024

using floating points in PHP is a bit risky! I recommend you to store numbers in string format and use bcmath or decimal addons for your calculations. (decimal is faster).

you can convert integer to float and send PR. i will review and merge.

from multipay.

parsagholipour avatar parsagholipour commented on August 24, 2024

I use number_format function and round the result everywhere. 😉
I will send PR.

from multipay.

khanzadimahdi avatar khanzadimahdi commented on August 24, 2024

round results! this could cause unwanted behaviors!

run the below code and see what happens

<?php

$x = 1.1;
$y = 0.2;
$z = 1.3;

var_dump($x+$y == $z);

from multipay.

parsagholipour avatar parsagholipour commented on August 24, 2024

Well logically 1.1 + 1.2 != 1.3
But I think you meant something like this:

<?php

$x = 1.4;
$y = 0.7;
$z = 2.1;


var_dump($x+$y == $z); // false
var_dump(number_format($x+$y, 2) == $z); // true, fix the issue

from multipay.

rayansys avatar rayansys commented on August 24, 2024
<?php


$x = 1.4;
$y = 0.7;
$z = 2.1;

$price =(float)str_replace(",","", number_format($x+$y, 2));

var_dump($x+$y == $z); // true
var_dump($price == $z); // true

from multipay.

hooman-mirghasemi avatar hooman-mirghasemi commented on August 24, 2024

با سلام
بنده هم این مشکل رو دارم دقیقا . و یه سوال دارم ظاهرا این لایبری دیگه خیلی فعال نیست و ایشیو هاش رو قرار نیست برطرف کنه؟
هم این ریپازتوری هم ریپازتوری لاراولش؟

from multipay.

khanzadimahdi avatar khanzadimahdi commented on August 24, 2024

@hooman-mirghasemi

از کجا متوجه شدید فعال نیست؟ شما تازه توی گیت هاب عضو شدین؟

مشکلی که دارید رو رفع کنید و درخواست مرج بزارید. پکیج اوپن سورس هست

from multipay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.