Liquid: Converting comma separated currency to dot separated - formatting

the price-decimals on my store are by default separated by comma (e.g. 6,99 €).
Now I need to convert them into dot separated version without the currency icon (e.g. 6.99).
Does anyone know how to do this with liquid filters? I'm stuck! I don't want to change the base-formatting settings in the store.
Thank you!

Something like this should do the trick:
{{ 145 | money_without_currency | replace:',','.' }}
https://shopify.dev/api/liquid/filters/money-filters

Related

How Splunk field contains double quote

When use Splunk, if we have log
key="hello"
Search in Splunk by
* | table a
we can see hello value
We might print out value with double quote, if we don't escape
key="hel"lo"
We'll see key value is hel. Value breaks before the position of quote
If try to escape double quote with \,
key="hel\"lo"
We'll see key value is hel\
Is use single quote around
key='hel"lo'
We'll see key value include single quotes, it's 'hello"lo'. In this case, search criteria should be
* key="'ab\"c'" | table a
single quotes are parts of value
Question is how to include double quote as part of value?
Ideally, there should be a way to escape double quotes, input
key="hel\"lo"
should match the query
key="hel\"lo"
But it's not.
I have this problem for many years. Splunk value is dynamic, it could contain double quotes. I'm not going to use JSON my log format.
I'm curious why there is no answer in Splunk's official website.
Someone can help? Thanks.
| makeresults
| eval bub="hell\"o"
| table bub
Puts a double-quote mark right in the middle of the bub field
If you want to search for the double-quote mark, use | where match() like this:
| where match(bub,"\"")
Ideally, the data source would not generate events with embedded quotes without escaping them. Otherwise, how would a reader know the quote is embedded and not mismatched? This is the problem Splunk is struggling with.
The fix is to create your own parser using transforms.
In props.conf:
[mysourcetype]
TRANSFORMS-parseKey = parse_key
In transforms.conf:
[parse_key]
REGEX = (\w+)="(.*\".*)"
FORMAT = $1::$2
Of course, this regex is simplified. You'll need to modify it to match your data.

How to convert dot to comma in smarty

Good morning,
Prestashop 1.6 in tpl file I have something like this
{assign var=groupPrice value=$psoft[0]['price']|number_format:2:",":"."}
<span class="price groupPrice">{$groupPrice*0.23+$groupPrice|number_format:2:".":","}</span>
The results is 456.34 (for example). How to convert this dot to comma?
Thanks for help.
Kind regards
you can use that :
math|replace:".":","
In code:
number_format:2:".":","
Replace the first dot to comma. You'll get the result:
number_format:2:",":","

how to remove special characters from string in volt templates

Please can anyone help me on this issue? how to remove special characters from string
Thanks in advance
You can use the filters available for Volt
https://docs.phalconphp.com/4.0/en/volt.html#filters
So your code becomes
{{ title | escape }}

Pentaho: How to replace commas with dots and vice versa(format)

I want to change in number-field format, commas with dots and dots with commas.
Thanks in advance!
VALUE 9,795.00
What I used to format number ###,###,###.00
And I want it to be like: 9.795,00
At the end I left formation like it is (###,###,###.00), because formatting depends on localization. I will set hardcoded localization value through java and when calling report it will forward french or german localization.

How to "unmold" a string?

I'm using this library to convert a block to a CSV. However, when it encounters a string with a comma in it it molds that string. Normally not a problem except that the curly-braces seem to confuse Excel.
So, {This, is a test} gets turned into | {this | is a test} | (each side of the comma is put into separate cells).
At first I thought I needed to escape the comma but it turns out what I need to do is turn the curly braces into quotes. Is there a quick or REBOL-recommended way to do this?
The purpose of 'MOLD in %csv.r is to wrap values containing commas into double quotes.
But unfortunately 'MOLD puts strings longer than 50 characters into curly braces instead of double quotes, for better readability.
I don't know how to affect this behaviour, so I would just replace 'MOLD in Item: mold Item and Heading: mold Heading with 'DBL-QUOTE, which would simply be defined as
dbl-quote: func[s][rejoin [{"} s {"}]]
Use csv-tools.r instead. It has that functionality built in, and is verified to be Excel compatible. It will work with Rebol 2 and 3, and has been in production use for years.