What parameters to use in the currency data field?
Hello UNA Team
I am about to add new Currencies in my system through:
Developer App > Forms > Data Items > System > Currency
and
Developer App > Forms > Data Items > Payment > Currency.
In Developer App > Forms > Data Items > System > Currency (sys_form_pre_values table), the currency data field has the following values:
AUD: a:1:{s:4:"sign";s:6:"A$";}
CAD: a:1:{s:4:"sign";s:6:"C$";}
EUR: a:1:{s:4:"sign";s:7:"€";}
GBP: a:1:{s:4:"sign";s:6:"£";}
USD: a:1:{s:4:"sign";s:5:"$";}
YEN: a:1:{s:4:"sign";s:6:"¥";}
So, my first question is: what is the meaning of: s:4 and s:6, s:5, s:7 in the currency data and what are they for?
As you can see, some Currency data use: s:6, others use: s:5 and s:7.
My second question is: when adding new currencies like: NZD, BRL, INR and ZAR, what parameters should I use for their data: s:6, s:5 or s:7 ?
Example:
a:1:{s:4:"sign";s:6:"NZ$";}
or
a:1:{s:4:"sign";s:5:"NZ$";}
or
a:1:{s:4:"sign";s:7:"NZ$";}
Thanks for advising.
-
-
·
LeonidS
- ·
Hello @OneEagle !
The data in question is characterized by a particular format, whereby a parameter denoted as "s:7" indicates the presence of a string variable with a length of precisely seven symbols.
-
·
LeonidS
-
- · OneEagle
- ·
Hi @LeonidS. Thanks for answering although I must confess that I didn't understand anything 😀
So e.g. for NZD and BRL what should I use: s:6, s:5 or s:7?
-
-
·
LeonidS
-
·
In reply to OneEagle
- ·
For NZD this variant will work:
a:1:{s:4:"sign";s:7:"NZ$";}
Because NZ$ has the 7-symbols length.
-
·
LeonidS
-
- · OneEagle
-
·
In reply to LeonidS
- ·
Ohhh ok. Got you!!! Now, I have understood it better with this typical example. Thanks a lot.
-
I'm working towards a donation system via Stripe. I have the currency setup as in the image below. When testing, I get message from stripe that the currency provided is invalid. Any help will be greatly appreciated.
-
use html currency code --- a:1:{s:4:"sign";s:7:"NZ$";}
-
Thanks for your assistance!
I entered that in and saved it. When I checked again, it was a:1:{s:4:"sign";s:7:"NZ$";} Stripe still sends the same error message.
-
Did you find this tutorial? Default currency (una.io)
As I can see in the picture, you have the wrong title field and value (__NZD)
-
-
·
LeonidS
-
·
In reply to PavelS
- ·
Yes, definitely so, dear @PavelS!
-
·
LeonidS
-
Thanks @PavelS ! I did not find that tutorial. Following that solved my problem.
@LeonidS The tutorial post has a list of suggested currencies to add upstream. Doing that would have reduced the friction in getting this set for me and would certainly help others adopt UNA as a platform.