1
0
Fork 0
freesewing/markdown/dev/reference/api/part/draft/units/en.md
2022-09-21 12:28:58 +02:00

503 B

title
units()

Calling units() in a part's draft method will format a float you pass it -- which should represent a value in mm -- into the units requested by the user.

The returned value is to be used in presentation only, as it will be a string that includes the user's units.

units() example

cont part = {
  name: 'examples.units',
  draft: ({ log, measurements, part }) => {
    log.info(`Pattern drafted for a ${units(measurements.chest)} chest`)

    return part
  }
}