wpcasa icon indicating copy to clipboard operation
wpcasa copied to clipboard

new option for thousands separator, space, not comma, not dot

Open Jimmi08 opened this issue 8 years ago • 5 comments

Now is currency separator hardcoded, you can't change this via filter like measurements

		$options_listings['currency_separator'] = array(
			'name'    => __( 'Thousands Separator', 'wpcasa' ),
			'desc'    => __( 'Please select the thousands separator for your listing prices.', 'wpcasa' ),
			'id'      => 'currency_separator',
			'default' => 'comma',
			'type'    => 'radio',
			'options' => array( 'comma' => __( 'Comma (e.g. 1,000,000)', 'wpcasa' ), 'dot' => __( 'Period (e.g. 1.000.000)', 'wpcasa' ) )
		);

We use space, not comma, not dot.

I have it fixed for now by changing core code, but it will be overriden with next update. To add new option would be great. Thank you

Jimmi08 avatar Feb 22 '18 21:02 Jimmi08

To be honest - this was the first time within the last 6 years that this had been requested. That being said it is currently not sure if we're going to add an option for that, but I'm sure we can at least add a filter hook.

JoeHana avatar Mar 08 '18 22:03 JoeHana

It's weird, but maybe you are focused on West Europe - comma or dot is decimal separator in our countries, we have only spaces. Filter would be enough. Thank you

Jimmi08 avatar Mar 09 '18 09:03 Jimmi08

Well, we're not really focused on a specific part of the world, but it is unfortunately quite hard for us to learn more about different use cases. That's why I mentioned that nobody have requested this within the last 6 years. For adding new options we always try to evaluate how useful they can be for the overall users. We try to avoid to "bloat" WPCasa with options which might only be useful for a handful of users while maybe confusing for the others.

So back to the topic we would love if you could tell us what country you come from or what countries are using space as a thousand separator?

As already promised, we're going to add a filter for it for sure, but would love to also see if a proper option would make sense.

JoeHana avatar Mar 21 '18 02:03 JoeHana

Hi, from Central Europe. Slovakia. Problem is decimal separator - it's comma. Thousand separator - none or space (just format) Example from one of our portals:

image

the filter is nice, but just adding new option in select box would be enough. Thanks

Jimmi08 avatar Mar 21 '18 13:03 Jimmi08

I am back to this. I updated wpcasa recently and totally forgotten about this and it took me long time to find again why prices are displayed with dots instead of spaces.

Because there is not filter, I can't change this without changing core file.

					if ( $listing_price_format == 'dot' ) {
						$listing_price = number_format( $listing_price, 0, ',', '.' );
						if ( is_array( $listing_price_arr ) )
							$listing_price .= ',' . $listing_price_arr[1];
					} else {
						$listing_price = number_format( $listing_price, 0, '.', ',' );
						if ( is_array( $listing_price_arr ) )
							$listing_price .= '.' . $listing_price_arr[1];
					}    

Just add the new option, dot, comma and space, nothing more.


                    $listing_price = number_format( $listing_price, 0, '.', ' ' );
				    if ( is_array( $listing_price_arr ) )
					$listing_price .= ' ' . $listing_price_arr[1];

Thanks

Jimmi08 avatar May 17 '20 11:05 Jimmi08