FP_s
Full Description
swirl
Syntax
  define external stream function FP_s
     (value float x, value counter DecimalPlaces optional)


Purpose

Converts and formats a floating point number into a character representation in scientific notation. The "s" parameter determines the number of decimal places rounded and shown. The DecimalPlaces counter indicates the number of decimal places to be printed. If DecimalPlaces is omitted, its value is set to 15.

The following demonstrates how to use FP_s to represent the speed of light in scientific notation:

  define external stream function  FP_s (value float x, value counter DecimalPlaces)
  process
    local float LightSpeed
    set LightSpeed to  FP_v "2.997924580E08"
      FP_s (LightSpeed, 10 )
    output "This is the speed of light in scientific notation: " || FP_s (LightSpeed, 10 ) || "%n"

This code produces the following result: This is the speed of light in scientific notation: 2.9979245800e+08.

Copyright © OmniMark Technologies Corporation, 1988-1998.