2
votes

We have designed the LN forms with editable fields.User enters the amounts in the editable fields. We are converting the these amounts to currency using 'CCur'. The actual issue is user enters the amounts with decimal separator either as comma(,) or dot(.). When converting the amounts to currency it is not considering the decimal and thousands separator. Example: User enters amounts as below: Amount1 = 2090,Amount2 = 1500,90 and Amount3 = 800 In the current case the TOTAL AMOUNT is calculated as 152980.00 which should be 4390.90 How can I achieve this? Do we have user specific settings in LN which automatically takes care such things?

Regards, Kishore

3
Ken' asnwer below is pointing in the right direction, but there's an even more fundamental question. You only say that the fields are editable. You don't actually say that the fields are number fields. They might even be text for all we know. So please tell us what the field type is for Amount1, Amount2, and Amount3. Also, even if they are number fields, CCur takes a string expression as input, so it's important to consider how the LotusScript code is actually reading the field values. So please show us the code. That's the only way that we can really know what's going on. - Richard Schwartz
I would say this is issue with users' OS language settings. Notes clients uses it to interpret numbers/times/dates. - Frantisek Kossuth

3 Answers

2
votes

It sounds like your currency formats may not be set up correctly, and thus the locale of the client being used to enter the value 1500,90 is one that assumes the comma is a thousands separator, and the period is a decimal separator.

Here is one section of the documentation to check-out. You may need to confirm the field settings on the form to see if a custom currency format has been specified. Otherwise, see what the user preferences of the client says

1
votes

For this question, I am not clear that why are you using comma as a decimal separator, I guess that it is not a formal way for storing the currency value. I can understand. this is your requirement. Just Take this as a suggestion. Okay We have the field property, First you change the field type as Number. And set the field control property, Number format is as currency and Change the User preference as Custom. There you can find two kind of settings enabled. Here you change the thousand separator into a different symbol. But I guess that you can not give multiple separator for decimal or thousands. Also If you give the same symbol for both things. It will be conflict.

My opinion- Based on your requirement, You do replace the comma with dot before applying the Ccur().

1
votes

@Ramkumar: I don't agree. Set the field settings to Numeric and "User settings", not "custom". The users need to use the correct decimal point, if they are in a country where a period is used for decimal point, they use that, if they are in a country where they use comma as decimal point, they use that. Kishore, you could add a field validation on the numeric field to make sure the value is numeric. Use @IsNumber for this.