/* Convert floating point value to ASCII. Maximum 4 decimals. */
void cn0415_ftoa(uint8_t *buffer, float value)
/* Convert floating point value to ASCII. Maximum 4 decimals. */
void cn0415_ftoa(uint8_t *buffer, float value)
{
	int32_t fraction;
	uint8_t local_buffer[20];
	float subunit;
	uint8_t i;
	itoa((int32_t)value, (char*)local_buffer, 10);
	strcpy((char *)buffer, (char *)local_buffer);
	strcat((char *)buffer, ".");
	subunit = fmod(value, 1.0);
	i = 0;
	while(subunit < 0.1 && i < 3) {
		strcat((char*)buffer, "0");
		subunit *= 10;
		i++;
	}
	fraction = (int32_t)(value * 10000) % 10000;
	itoa(fraction, (char*)local_buffer, 10);
	strcat((char*)buffer, (char*)local_buffer);
}