SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru TacMaf's Avatar
    Join Date
    Dec 2005
    Location
    Manchester, United Kingdom
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Convert to minor currency

    Hi,
    Does anyone know the best way I can convert a string into minor currency?

    i.e. 10.00 would become 1000

    I can't just take out the decimal because it could also be 6.5 to 650 or 5 to 500.

    Cheers,
    Rhys

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2011
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that you want the major currency, not the minor. If so, try to multiply the value with 100.

  3. #3
    SitePoint Guru TacMaf's Avatar
    Join Date
    Dec 2005
    Location
    Manchester, United Kingdom
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I should take some time off...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •