Jump to content

Search the Community

Showing results for tags 'rounding'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. chob1234

    Rounding

    Confused on why my toFixed(2) function is not rounding my output. Located at the bottom of my code here. My output is "501327.3600770543" //// Get the sq inch. for BuildIDs that start with AA and //// sets value to the "result" variable var result=0; var params = { maxItems: 100000 /* NUMBER */ }; //// result: INFOTABLE var itPartInfo = Things["Training.InfoTable.PartInfo"].GetDataTableEntries(params); // Return square inches of Oak needed for each build ID that starts with AA // Like type filters by a like criteria // filters rows from Infotable PartInfo var query = { filters: { "type": "AND", filters: [ { "fieldName": "BuildID", "type": "LIKE", "value": "AA*" }, { "fieldName": "MaterialType", "type": "EQ", "value": "Oak" } ] } }; var oakparams = { t: itPartInfo /* INFOTABLE */, query: query /* QUERY */ }; // result: INFOTABLE var sqresult = Resources["InfoTableFunctions"].Query(oakparams); //Infotable for loop snippet var tableLength = sqresult.rows.length; // for loop will loop through itPartInfo, calculate the sq. in. for each part that starts with AA and return // sq. in. in "result" for (var x = 0; x < tableLength; x++) { var row = sqresult.rows[x]; //Your code here //+= addition assignment operator is basically same as "x = x + y" result += (row.Height*row.Width); result.toFixed(2); }
×
×
  • Create New...