]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - lib/strmhz.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2002-2006
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 char *strmhz (char *buf
, unsigned long hz
)
13 n
= DIV_ROUND_CLOSEST(hz
, 1000) / 1000L;
14 l
= sprintf (buf
, "%ld", n
);
17 m
= DIV_ROUND_CLOSEST(hz
, 1000L);
19 sprintf (buf
+ l
, ".%03ld", m
);