wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/FormatNetWt

Version 2 (modified by Don Wilson, 14 years ago) ( diff )

--

FormatNetWt

Format a string representation of the net weight

string FormatNetWt(int nScale, int nLen = 7);

char* FormatNetWt(int nScale, char* pszBuffer, int nLen = 7);

Parameters

  • nScale - scale number
  • pszBuffer - character array to write result into. Must be long enough to hold the string and null terminator.
  • nLen - length to format the string, spaces will be padded to the left.

Return Value

  • Returns the string formatted net weight.

Remarks

This will format the raw net weight into appropriate divisions and add zeros for zero weight if necessary based on the interval. For example, if interval of 20 lb is specified and the weight is zero the output will be " 00".

Examples

string strWt = FormatNetWt(1);
DisplayText(0, 0, strWt);
char szWt[20];
FormatNetWt(1, szWt);
DisplayText(0, 0, szWt);

See Also

Note: See TracWiki for help on using the wiki.