Features
      Ask DevGuru
      ASP Resources
      Find the Bug
      Knowledge Base
      Links
      Tips of the Week
      Tutorials
  Products
      dgCalendar
      dgCharge New!
      dgChart New!
      dgFileUpload
      dgReport New!
      dgSort
      dgTree
  Site
      Authoring
      Coming Soon
      DevGuru Resume
      Link to Us
      Merchandise
      Sponsorships
      Testimonials
      What's New
  Technologies
      ADO 2.6
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      Transact-SQL Syntax
      VBScript
      WML
      WMLScript
      WSH
      XML DOM

              











FUNCTION:  Fix( )

Implemented in version 1.0
 
Fix(Number)
 
The Fix function converts a decimal number (floating-point) to an integer number (fix-point).
 
There is a companion function Int that also converts to integers. There is one major difference between Int and Fix. Int rounds negative numbers down. Fix rounds negative numbers up.
 
Code:
<% =Fix(123.456) %>
 
Output:
123
 
Positive numbers are not rounded up. The decimal point and all digits to the right are effectively chopped off.
 
Code:
<% =Fix(123.899) %>
 
Output:
123

 
Negative numbers can also be converted. Negative numbers are rounded up (towards more positive). The decimal point and all digits to the right are effectively chopped off.
 
Code:
<% =Fix(-123.899) %>
 
Output:
-123


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information