Euro Currency formatting - coldfusion

I am using
LSEuroCurrencyFormat(2500)
to format the price. the output is like
2.500,00 €
but I want to display the price like
2.500,- €
how may I do this?

replace(LSEuroCurrencyFormat(2500),",00",",-")

Related

Extracting currency value in Google Sheets with regex

I am trying to extract the tip value from columns in Google Sheets. What would be the proper regex argument to use to do this? Some columns do not have the tip value, and in this case i would like it to return "0".
Tip - 20% x $134.00Damage Waiver: 5% x $40.20Coupon: Thanks for considering us!! x -$10.00Tax: 7.25% of $700.20 x $50.76
If the input string (let's say at A1) has the word "Tip", and the first dollar symbol after that initiates the amount of interest, then do:
=IFNA(VALUE(REGEXEXTRACT(A1, "\bTip\b[^$]*\$([\d.]+)")), 0)
This expression will produce a number type, so the dollar is not included.
Apply the desired number formatting to the cell where you place this formula to show a currency symbol, and the required number of decimals.

My formula only keeps one word and not anything after spaces

I am basically trying to omitted all illegal characters and numbers in a soft drinks column. I currently have something like this:
Soft Drinks
Dr Pepper;1234
Pepsi369
Coca Cola
Red Bull
Mountain Dew;11
Gatorade
Fanta
Crush Soda456
Essentially I want something like this:
Soft Drinks
Dr Pepper
Pepsi
Coca Cola
Red Bull
Mountain Dew
Gatorade
Fanta
Crush Soda
I tried using this formula: =ARRAYFORMULA(REGEXEXTRACT(A1:A9&"", "[a-zA-Z]+")) but instead I am only getting the first word in the list please see below:
Soft
Dr
Pepsi
Coca
Red
Mountain
Gatorade
Fanta
Crush
Not sure where I gone wrong. I even tried fixing the regex like this and it still dont work: =ARRAYFORMULA(REGEXEXTRACT(A1:A9&"", "[a-zA-Z]+[a-zA-Z]+"))
This regex should work: [a-zA-Z\s]+
=ARRAYFORMULA(REGEXEXTRACT(A1:A9&"", "[a-zA-Z\s]+"))
I only added \s so that space between words would also be included in your pattern. You can also use [a-zA-Z ]+, as using \s would match any whitespace character.
Use this working, better for you formula
=ARRAYFORMULA(IFERROR(REGEXREPLACE(B2:B,"[\d]+$|;","")))
See problem with other formula here.

Total excl/incl from string using regexp

I've been reading this post Return only one group with OR condition in Regex to get an understanding how to get only one group in match. Somehow that does not work on my pattern.
Here is the used string:
Ledigingen 4 lediging € 32,48 € 50,92 21,00 %
van 01-01-2019 t/m 31-01-2019
Huur 1 Maand € 8,63 € 8,63 21,00 %
toeslag over € 50,42 (21% BTW) € 2,76 21,00 %
(WHITESPACE) Totaal exclusief BTW € 50,18
BTW hoog (21%) € 50,18 € 50,89
totaal inclusief BTW € 70,07
Currently it extracts each occurence of amount. Is there a way to get only values followed by [Tt]otaa?l excl/incl BTW?
I guess I've been using positive/negative lookahead wrong.
Desired output from the given input is:
€ 50,18
€ 70,07
DEMO
RegEx
(?!<=[tT]otaa?l\s*?.*?)([€$]\s*\d+(?:[,.]\d{0,2})?)

How do I concatenate cells and add extra text?

I'm very new to Calc but a relative veteran with Excel. Unfortunately I don't have the latter available to me. I'm attempting to create a new cell inline with the data I need to use like the below
AF Afghanistan
AL Albania
DZ Algeria
with an output in Column C like this
<option value="AF">Afghanistan</option>
I've tried to use the CONCATENATE function to no avail. Could someone point me in the right direction on how to achieve this in OpenOffice Calc (Version 3).
Thanks
I suppose it's a problem of escaping the quotes, since they delimit the "extra strings", too. Anyway, it should work with CONCATENATE, using this formula:
=CONCATENATE("<option value=""";A1;""">";B1;"</option>")
EDIT:
Sorry, every time messing up argument separators (with german l11n, semicolons instead of commata are used...) With an english (US) localisation, you need this version:
=CONCATENATE("<option value=""",A1,""">",B1,"</option>")
If doubling the qoutes around the first cell reference doesn't work, try to replace it with CHAR(34) (the decimal ASCII code for double quotes is 34, while 22 would be the hex value):
=CONCATENATE("<option value=",CHAR(34),A1,CHAR(34),">",B1,"</option>")
suppose 'AF' was in column A1 and 'Afghanistan' was in column C1, then this would produce the desired result
="<option value='"&A1&"'>"&C1&"</option>"
That code would give you this output
<option value='AF'>Afghanistan</option>

django thousand separator for product price in templates

i have the product price in decimals,
like 15000.0000
now i want to apply thousand separator on it, intcomma filter works fine with decimals as here
but after it i can't apply currency filter, means it didn't work with currency filter.
i want final output of my Price: PKR 15,000.00
any suggestions to get this?
Thanks :)
The satchmo currency filter requires something that can be converted into a Decimal. However intcomma returns a string, and since it adds the thousand separators, it can no longer be converted to a Decimal.
The solution would be to write a currency_with_intcomma template filter yourself, which first runs through the currency filter and then applies the thousand separators (you can't use the builtin filter for that, you'll have to do it "manullay").