Hi
Does anyone know how to change the formatting on values returned from databaseManager.getDataSetByQuery()?
I am running the method and it is automatically formating the value to 1.4110860815E10 when it needs to return 14110860815
Or does anyone have any other suggestions on how I can resolve this?
I am using this dataSet in an html area as follows
html_area_txt = ‘’+ds.getAsHTML()+‘’;
Thanks
Ernest
Hi Ernest,
I see this is your first post so welcome to the forum ![Smile :)]()
As for your question, I guess you could cast the column to a string in the SQL so JavaScript will treat it as is.
Hope this helps.
If you set the format property of field to “#”, you can see the right value, I think.
Thank you ROCLASI and juan.cristobo for the warm welcome and suggestions
I tried the formatting suggestion, and that did not have any effect on the field.
Changing of the sql is not an option in this case as the form is a sql testing form where the clients do not wish to cast their columns.
I noticed the ability to set html tags, would that work? if so, what tag would you suggest I modify to get this formatting to work.
Thank you
getAsHTML() does not format any values it just depends on the toString() of the various data values that are in it
the quickest way to do it right now is to query it, then walk first over your whole set formatting the columns you want to format (for every row)
and set it back
so something like
dataset.setValue(1,1, formatNumber(dataset.getValue(1,1)));