[PATCH v1 1/1] cmd: setexpr: add dec operation for converting variable to decimal

Wolfgang Denk wd at denx.de
Wed Jun 23 08:08:50 CEST 2021


Dear Simon,

In message <CAPnjgZ13=2SCsZC1Y+m-HZOiBhpGiEFe2dRWwK9sAZHutgaO7Q at mail.gmail.com> you wrote:
>
> >  > 0m123 ? ('m' for deciMal).
> >
> > Perhaps 0d123? Though I would prefer to remove many of the implicit
> > assumptions of hex input.
>
> Right, we can't use 'd' because it is valid hex.
>
> I believe hex is the right default. We just need an easy way to use decimal.

Maybe we should make this more general and support an even wirder
range of formats?  Instead of just converting to decimal, we could
pass a format string for sprintf() ?

Like:

	# setexpr foo fmt %d $value

?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Question: How does one get fresh air into a Russian church?
Answer:   One clicks on an icon, and a window opens!


More information about the U-Boot mailing list