Number - Fixed Width Number Conversion routines =============================================== File: Number - Update: 1.02 Author: J.G.Harston - Date: 15-Sep-2009 The Number library provides functions to convert integers to fixed width strings in hexadecimal, decimal, octal and binary. Requirements and Dependancies ============================= None. Convert integer to hexadecimal string ===================================== DEFFNh0(A%,N%) - hexadecimal padded with zeros DEFFNh(A%,N%) - hexadecimal padded with spaces FNh0() converts the supplied number to a fixed width hexadecimal string padded with zeros, FNh() converts the supplied number to a fixed width hexidecimal string padded with spaces. For example, FNh(10,6) returns " A" and FNh0(-1,8) returns "FFFFFFFF". Convert positive integer to decimal string ========================================== DEFFNd0(A%,N%) - decimal padded with zeros DEFFNd(A%,N%) - decimal padded with spaces FNd0() converts the supplied positive integer to a fixed width decimal string padded with zeros, FNd() converts the supplied integer to a fixed width decimal string padded with spaces. For example, FNd(10,6) returns " 10", FNd0(10,6) returns "000010" and FNd(-10,6) returns " -10". Convert integer to octal string =============================== DEFFNo0(A%,N%) - octal padded with zeros DEFFNo(A%,N%) - octal padded with spaces FNo0() converts the supplied integer to a fixed width octal string padded with zeros, FNo() converts the supplied integer to a fixed width octal string padded with spaces. For example, FNo(10,6) returns " 12" and FNo0(10,6) returns "000012". Convert integer to binary string ================================ DEFFNb0(A%,N%) - binary padded with zeros DEFFNb(A%,N%) - binary padded with spaces FNb0() converts the supplied integer to a fixed width binary string padded with zeros, FNb() converts the supplied integer to a fixed width binary string padded with spaces. For example, FNb(10,6) returns " 1010" and FNb0(10,6) returns "001010". Version History =============== 1.00 09-Aug-1988 First version written. 1.01 12-Feb-1992 Added Octal and Binary 1.02 15-Sep-2009 Octal and Binary works for &8xxxxxxx