+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Does anyone know how to format currency

  1. #21
    Guru
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    2,028
    Quote Originally Posted by Wei Hong View Post
    There is a script that can do all the formatting that I had posted on page 1. http://numeraljs.com/
    I just don't know how to implement it to flynax price.

    http://php.net/manual/en/function.number-format.php

    there is this page with some simple php code on it ? I am guessing it is in php is it ? and you want to apply it to the price section of the account?

    Can I ask if why you have not just built a simple $ field or adjusted the one you have and changed the options at the end from UK, AU etc as in currency to $ amounts such as K, M, etc ?

    so they would type in 1.2 and then select from the dial up 1.2 K or 1.2 M etc so the customer ads it as it should be ? just add to help the information / example on using price section.

  2. #22
    Quote Originally Posted by Pete Young View Post
    http://php.net/manual/en/function.number-format.php
    Can I ask if why you have not just built a simple $ field or adjusted the one you have and changed the options at the end from UK, AU etc as in currency to $ amounts such as K, M, etc ?
    Because if I do as you suggest then $1.2k is 1.2 with a unit named k, and not $1,200. If seller put 1 with unit "m," 1000 with unit "k" is the same price but it will not show the same result.

  3. #23
    I also have another unit for rent: $/month, $/week. So it won't work with your method. But thanks though for the suggestion. I would really grateful if you can show us how to implement the script from http://numeraljs.com/ to price tag field in flynax.
    Last edited by Wei Hong; July 13, 2016 at 01:15 PM.

  4. #24
    Guru
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    2,028
    Quote Originally Posted by Wei Hong View Post
    I also have another unit for rent: $/month, $/week. So it won't work with your method. But thanks though for the suggestion. I would really grateful if you can show us how to implement the script from http://numeraljs.com/ to price tag field in flynax.
    Sorry the Idea wont work, looked at that code and is probably something I cant work with, but I will try when I get 5 mins anyway. have you asked flynax in a ticket to create it for you or get a programmer from freelancer or similar ?

  5. #25
    Hello Wei,

    You can try to change it here: ftp://includes>>classes>>rlValid.class.php
    add new method:

    PHP Code:
    Only registered members can view the code
    Then open file: ftp://includes>>classes>>rlCommon.class.php find method: adaptValue and code:

    PHP Code:
    Only registered members can view the code
    and replace to:
    PHP Code:
    Only registered members can view the code
    save and check again.
    Viktor,
    Flynax technical department,
    Best wishes.

  6. #26
    Thinks viktor The code works

    jats a question, how I can get this result ?

    1234 Da >> 1,234 M Da
    12345 Da >> 12,345 Mi Da
    123456 Da >> 123,456 Million Da
    1234567 Da >> 1.234,567 Millard Da

    finaly

    Outputs:

    247,704,360 -> 247.7 million
    866,965,260,000 -> 867 billion

    becaus the problem now is when the money is like that :

    12345 Da >> 1.3 million Da



    thnkis
    Last edited by nirvano; July 15, 2016 at 01:02 PM.

+ Reply to Thread