Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space or other special characters break formatting #58

Closed
imbrish opened this issue Nov 4, 2016 · 7 comments
Closed

Space or other special characters break formatting #58

imbrish opened this issue Nov 4, 2016 · 7 comments

Comments

@imbrish
Copy link
Contributor

imbrish commented Nov 4, 2016

Function below doesn't give results that one would expect if format involves extra space, dot etc.

currency(12345.6789)

Two examples:

  1. kr 1,0.00kr 12 345,6789
  2. kr. 1,0.00kr. 12.346

Both formats are default so it looks like something doesn't work as it should ;)

imbrish added a commit to imbrish/laravel-currency that referenced this issue Nov 4, 2016
@dovid
Copy link

dovid commented Nov 17, 2016

I had the same experience with Danish Krone and New Israeli Shekel. I didn't test any others for now.

@Torann
Copy link
Owner

Torann commented Apr 25, 2017

Is this still an issue? I can't seem to reproduce it. Can you give me an exact example? Like the value you are sending to the method and the currency you are formatting it to along with the output you get and the output you expect.

Example:
currency_format('122,433.06', 'DKK')122 433,06 kr.

@dovid
Copy link

dovid commented May 19, 2017

Yes, I still see this issue. Here's an example.

currency_format('10.00', 'BRL')R$ 10,0000

@4nd
Copy link

4nd commented Aug 3, 2017

I think I've fixes this issue, was encountering it with ZAR

The format for ZAR is in as 'R 1,0.00' but from looking at the code, the system works out that the decimal seperator is the , so it looks for this in the string and the number of characters after it denotes the decimal places, so changing this code to 'R 1,0,00' resolves the issue.

Not sure if I've read this right but it fixed it for me for this currency.

@Torann
Copy link
Owner

Torann commented Aug 4, 2017

Oh perfect. I'll add a fix to the currency format presets. Thank you

@Torann Torann closed this as completed Nov 27, 2017
@csb346
Copy link

csb346 commented Nov 23, 2019

Hi... Did you actually fixed this issue?

I'm still having this problem. For example:
ZAR format: R 1,0.00
BRL format: R$ 1,0.00

currency_format(8214.246,'ZAR') => R 8 214,2460 (Should be R 8,214.25) currency_format(8214.246,'BRL') => R$ 8 214,2460 (Should be R$ 8,214.25)

If I remove the space in the format it works fine.

@krychu90
Copy link

Still not fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants