function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NasreenbanuNasreenbanu 

Not able to get the string value as it is in javascript if it contains a number and mathematical operators

Hi,

I have a text datatype field which contains numbers and an operator(-) When I try to get this field value in javascript, I am getting the substarcted value.

For ex: the original value is 341302-01. When I try to get this value in javascript, I am geeting 341301 where the auto substarct happened like 2-01, so it returns 1. Please let me know if you know the way to get the original value in jaavscript as it is available in DB including -.

Appreciate your help.
Sandesh D GanjareSandesh D Ganjare
Hi Nasreenbanu,

1. Enclosed that value into a single quote so that in JS it will identify as a string.
2. Using String() function in JS convert that value to a string.

Thanks.