Tokens [entity:field_x:number] adds unexpected precision (.000000)

Created on 15 August 2024, 5 months ago

Problem/Motivation

We're using a physical number field with a value of "105mm"

When using the token: [term:field_width_inner:number] we'd expect "105" as result, but the token result is: 105.000000

Steps to reproduce

Create a physical field with a value having no precision (e.g. "123")
Use the token with :number modifier of the field and see unexpected zero-precision added to the value: 123.000000

(I'm treating this as bug, improvements / additons to the tokens will be handled here: Provide tokens with/out unit and target unit Active )

Proposed resolution

Remove the trailing zeros if there's no good reason of explicit precision set!

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024