0

I need to find how many digits there are in Price area after delimeter to compare

I used this code but not working properly because all region dont use same delimeter

Do you have better idea ?

strSalesPrice     = conPeek(record,5);
delimeterPosition = strFind(strSalesPrice,",",1,strLen(strSalesPrice));

if (delimeterPosition!=0)
{
   afterDelimeter = subStr(strSalesPrice,delimeterPosition+1,strLen(strSalesPrice));                        
   if(strLen(afterDelimeter) > SalesParameters.DfcDigitSize)
   {
     throw error("Please check the number of digits after the decimal point");
   }
}
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
yalcinpkr
  • 15
  • 4
  • Use math instead of programming. You need to be MORE CLEAR with your question. I see you're looking for a `,` symbol, but is that for a number like `1,000.123` or is that `1.000,123`? If you were trying to find `.123`, you could just convert your value to a `real` and declare an `int` and assign the real value to the int, then do `real - int` to get the decimal remainder. Still no clue what you're trying to do though because your question is not clear. – Alex Kwitny Sep 24 '21 at 00:02
  • need to find length of .123 but system rounding if i do your solution ,123 become ,012 so its not correct must be .123 is it clear ? – yalcinpkr Sep 24 '21 at 05:58
  • I think it is still unclear. Could you [edit] the question and add an example of two numbers you want to compare and walk us through the process how you would do it manually and what the expected result should be? – FH-Inway Sep 24 '21 at 14:39
  • @yalcinpkr it seems your problem may be string conversion. Why are you using a string to work with a `real`? And your comment doesn't make sense. `,123` can never become `,012` unless you're doing the math wrong. Please edit your question and give examples of what you want. – Alex Kwitny Sep 24 '21 at 16:38

0 Answers0