Quantcast
Viewing all articles
Browse latest Browse all 5794

Quirky NumberFormat issue..

Hello, everyone,

 

I've got a confusing bit happening, right now.

 

I'm using SpreadsheetNew() to generate an Excel report AFTER a page with the exact same data is loaded.  (Basically, the data appears, then the page can be resubmit to generate the Excel.. and it's not like the data in the database changing would have an effect - I'm serializing the data to JSON, posting it, then deserializing it back into a query object.)

 

I've got numbers that appear like "1728074" and I'm dividing them by 12 (to get 144006.1666666667) and using NumberFormat on the display page and it's working just fine.

 

Trying to replicate the same math and logic for the page that creates the Excel spreadsheet.  The same logic is giving me the same full number (144006.1666666667), but when I apply NumberFormat() (with or without a mask) to that value, it's as if the value is being divided by 1000!  So, instead of getting 144006, it's giving me 144.  That's it.

 

I'm not applying cell formatting prior to the data being entered, so the default data type of the cells (I think it's "GENERAL") is being used - but I pass val() values, so these are appearing in the spreadsheet as integers or decimals.

 

What could be causing NumberFormat() to alter the value of the given number??

 

Thanks, and V/r,

 

^_^


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>