Modeller.convertToString


convertToString(input, [showAllDigits], [locale], [dimensionality], [unitSet])

Converts the input number into a string, ready formatted for display The string will have been formatted using the current number of significant figures (modified using setDisplaySigFig or setDisplayDecimalPlaces) and is presented in engineering format, with the exponent, if any, modified to be an even multiple of 3.

inputdouble or long The input number
showAllDigitsoptional boolean If true (the default), ignore the number of significant figures set using setDisplaySigFig or setDisplayDecimalPlaces, and instead show all available precision
localeoptional string If given the locale in which to make the conversion, examples are similar to those shown in the Windows international settings dialog: "English", "English_United Kingdom", "French", "French_Monaco" etc. The special value of "C" may be used to represent standard US English number formating If not given, the Windows locale at the time Modeller was launched will be used
dimensionalityoptional integer Defines the dimensionality of the input string.
unitSetoptional string The unit set that we need to convert to (e.g "N,mm,t,s,C"). If it is not given (unitSet = ""), no conversion will occur.
Return valuestringThe output string

Example


 ' display a neatly formatted stress of 0.05 (given in model units), converted into "N,mm,t,s,C"
 msgbox convertToString(0.05, false, "C", packDimensionality(0,1,-2,0,0,0), "N,mm,t,s,C")
 

Back to Modeller

Back to Overview