0

I have an oracle apex interactive report. I have added an onclick event to some columns in my interactive report. Some of the cell values which I have passed as parameter to JS function have value starting with zero. This values are automatically converted to octal. This is my JS function call.

set_val(#SLIPNO#, #CODE# , #ACCNO#);

Where SLIPNO,CODE,ACCNO are column headers. The CODE has value starting with zero in some of the rows. When the cell value of CODE is 0112, I got the value 74 in JS function. How to solve this?

Nash Carp
  • 169
  • 12
Nidheesh
  • 802
  • 1
  • 21
  • 44
  • Possible duplicate of [How do I work around JavaScript's parseInt octal behavior?](https://stackoverflow.com/questions/850341/how-do-i-work-around-javascripts-parseint-octal-behavior) – Alex Poole Jan 15 '18 at 11:25
  • Its not exactly a duplicate question. This could be useful to someone else woking with Oracle Apex. But, agree that Alex Poole's link would probably solve the problem. – Teddy Jan 15 '18 at 13:56
  • Well, either `set_val` takes a string argument and converts it, so that needs to be modified; or it takes a number and the call has to be modified to explicitly convert the string value to a number? – Alex Poole Jan 15 '18 at 14:45
  • The above answer does not works for me. I replaced the function calls as set_val(#SLIPNO#,parseInt(#CODE#,10),#ACCNO#); and set_val(#SLIPNO#,Number(#CODE#),#ACCNO#);. None work for me. CODE is a varchar2 item in my DB table. – Nidheesh Jan 16 '18 at 04:49
  • when I inspect the code I can clearly see the function call as- set_val(7,0112 ,8662) – Nidheesh Jan 16 '18 at 05:55

0 Answers0