Search these areas:
Help
Support Forums
Product Info



-Introduction
-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Views
-Templates
-Components
-Data Analysis
-Members
-Security
-Importing
-Exporting
-FTP
-JavaScript
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-Glossary
-New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

Support Forum



How do I fix a script that won't run due to incorrect data type
Josh_Fulleton asked:
DataWeb Script is automatically converting data types in a
   number of contexts. Numbers are automatically converted to
   strings whenever numbers are concatenated with strings. So I
   have converted the value to number datatype before putting it in
   calculation.

   Below is the old code which was causing issue:

    actHPPD = totalUnitShift *4/(maxStartOfDayUnitShift +
   totalCensusAdjustment + diffAdmitsDischarges/2)+maxBdgtHPPD +
   maxBdgtIndHrs/(maxStartOfDayUnitShift+totalCensusAdjustment+diffAdmitsDischarges/2);

   Updated code to fix that issue:

   We have decleared below variables:
   var numVal=0;
               var numVal1=0;
               var numVal2=0;
               var numVal3=0;
               var numVal4=0;
             
   numVal = new Number(totalUnitShift);
                                               
                   numVal1=((new Number(maxStartOfDayUnitShift) +
   new Number(totalCensusAdjustment) + new
   Number(diffAdmitsDischarges)/2));

                   numVal2=(new Number(maxBdgtHPPD));

                   numVal3=(new Number(maxBdgtIndHrs));

                   numVal4=(new Number(maxStartOfDayUnitShift) +
   new Number(totalCensusAdjustment) + new
   Number(diffAdmitsDischarges)/2);
                
                   actHPPD = new Number(numVal) * 4 / new
   Number(numVal1) + new Number(numVal2) + new Number(numVal3) /
   new Number(numVal4)
 
  Josh_Fulleton (DataWeb) responded:
  Dataweb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

Thanks,
Dataweb Support
 
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us