when i pass the value to the code am getting below error
if( null(ac!convertWord_txt), "zero", convertnumbertoword( trim(split(ac!convertWord_txt, ".").[1]), "" ) )
what might be the issue here
Discussion posts and replies are publicly visible
That plugin is not updated since 2017....
What is the functionality that you need to implement? Maybe we can find way to do it...
if i pass the integer it has to give me the word of the integer
200 if i pass it should give me two hundred
Ok, that plugin accepts the following parameters
public String convertNumberToWord(ServiceContext sc, @Parameter Long number, @Parameter String standard) {
Could you please cast this value ac!convertWord_txt, to integer and try again?
yes i checked in db, the value 200000000 from UI storing in db as 2e+08
so in such cases how to handle this
I would say implmenting your own expression rule implementing that logic.
2e+08 is just the way Appian DISPLAYS larger numbers. Appian does NOT somehow transform that value.
Can you try to make that code simpler by using a static value?
convertnumbertoword(200000000.0, "")
Try this.
Then, I have questions:
- What is the purpose of line 2? If you want to check for a null value, use a!isNullOrEmpty()
- What is the purpose of line 5? Seems like you store numeric values as text. Why?
yes, am checking null check over 2nd line, we have our own rule to check null check so i just mentioned here null
it's a numeric value i'll change it line 5
yes we can get value for lengthy numbers but while saving to it db it is storing with exponent value post saving to db will fetch the value and converting the integer to word and showing on the UI in other place
Your database is NOT converting your value into anything! This seems to be a very common misconception that Appian "converts a number into scientific notation". This is just plainly wrong!
For any software to display any numeric value on a screen, it needs to turn that numeric value into a string using characters. Typically 0-9.
I think that the easiest way would to convert the number to text , and implement the same logic in you own rule, but using the value casted.... in that way you won't have that kind of problems.
Do you need details about how it the smart service works?
the Data base has 200000000 only but when i query, the query is giving the exponent value
Is convertWord_txt a number? If so, try this
if( null(ac!convertWord_txt), "zero", convertnumbertoword(fixed(ac!convertWord_txt, 0,false), "" ))
That query does NOT return anything as an "exponent value"! Really!
but in our case it is returning
This works fine for me
still this is giving error
these type of values i get from query have to convert the values to word
Are you using the code posted by Mathieu or by me? Could you post the way you are doing it please?
The problem in this case probably could be related with the way you are receiving the values...
Just change the input to an array and add a forEach.