Menu

Some questions about formatting and units

6 days ago
5 days ago
  • Mark Goossens

    Mark Goossens - 6 days ago
    • Is there also a setGroupingSeparator('.') method available?
    • Instead of using SIGFIGS(3) as an example, can I set the number of significant digits directly?
      For example, to show values like 540.678,98 and 5.127.658,20

    • Could you clarify which SI units are supported and how the system handles them?
      The reference files seem to be inaccessible.
      I primarily use: kN, N, N/mm², where kN equals to 1.000,00 N
      How can I use SI prefixes, like :
      "k" which stands for kilo-, and means 1.000 (10³).
      "c" which stands for centi-, and means 0,01 (10⁻²).
      For example, kN, kg, cm, m, km, mm, ...

    • Is it possible to use currency symbols (e.g., €) as units?
      For example, to calculate values like €/m²?

    Kind regards,

    Mark

     
  • Toby Rule

    Toby Rule - 5 days ago

    I think most of your questions will be answered by demo document:
    https://sourceforge.net/p/comppad/repo/ci/Python/tree/test/CompPadDemo.odt

    • There is a setThousandsSeparator function for setting the thousands grouping separator that is used in the displayed results.
    • For significant figures display, you can use setSigFigs function.
    • You can see in the demo document how to apply the units, including how to specify the display units in an expression. For instance, you can evaluate the expression:

    x := 1000 m/s = km/hr

    evaluates to:

    x := 1000 m/s = {{"3 600"`}}km/hr

    • I will create a comprehensive list of units soon, but most of the standard SI units work, with the typical prefixes.
    • Currency units aren't currently supported. You could just define a currency symbol as 1 and use it in the units for display purposes:

    €:=1
    500 €/kg = {{"0.5000"`}}€/g

     

Log in to post a comment.