Jump to content

it is possible to place the point of the thousands


Guest alejo139

Recommended Posts

Guest alejo139

hello greetings, that well that the CC3 version follows developing, but that possibilities there is to be able to add to the cost of the product the point that divides the thousands of the price example in you see of being 1000.00 is 1.000,00. Thanks for the attention good day for all. */*

Link to comment
Share on other sites

Yes, you absolutely can. I came up with this fix sometime back, but I'll repost it again.

You'll need to edit /includes/functions.inc.php and replace the priceFormat function with the one below.

//////////////////////////////////

// Format Price

////////

function priceFormat($price, $dispNull = FALSE){



	if($price == TRUE){



  global $currencyVars;



  $price = $price * $currencyVars[0]['value'];



#################################################################

#  Edit made by Sir William -- http://www.swscripts.com/

#  Here's the original line from the code:

#  return $currencyVars[0]['symbolLeft'].

#  sprintf("%.".$currencyVars[0]['decimalPlaces']."f", $price).

#  $currencyVars[0]['symbolRight'];

#

#  The following line will properly format the number with commas and a

#  decimal in US format like this:  1,234,567.89



  return $currencyVars[0]['symbolLeft'].

  number_format($price, $currencyVars[0]['decimalPlaces'], '.', ',').

  $currencyVars[0]['symbolRight'];



#  If you'd like a European convention of: 1.234.567,89 simply comment

#  the above line and uncomment the one below



#  return $currencyVars[0]['symbolLeft'].

#  number_format($price, $currencyVars[0]['decimalPlaces'], ',', '.').

#  $currencyVars[0]['symbolRight'];



	} elseif($dispNull == TRUE) {

  global $currencyVars;



#################################################################

#  Edit made by Sir William -- http://www.swscripts.com/

#  Here's the original line from the code:

#  return $currencyVars[0]['symbolLeft'].

#  sprintf("%.".$currencyVars[0]['decimalPlaces']."f", 0.00).

#  $currencyVars[0]['symbolRight'];

#

#  The following line will properly format the number with commas and a

#  decimal in US format like this:  1,234,567.89



  return $currencyVars[0]['symbolLeft'].

  number_format(0.00, $currencyVars[0]['decimalPlaces'], '.', ',').

  $currencyVars[0]['symbolRight'];



#  If you'd like a European convention of: 1.234.567,89 simply comment

#  the above line and uncomment the one below



#  return $currencyVars[0]['symbolLeft'].

#  number_format(0.00, $currencyVars[0]['decimalPlaces'], '.', '.').

#  $currencyVars[0]['symbolRight'];



	} else {



  return FALSE;



	}

}

You'll have to uncomment the European version and comment out the US one, but that's really no big deal.

Have fun!

*/*

Link to comment
Share on other sites

Guest alejo139

Thank you very much friend Sir William by the aid, I make the changes and tests and warning as it works. :D

and excuseme by my badly handling of the language english, is not my native language */*

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...