user320487
user320487

Reputation:

PHP/PEAR - Retain trailing zeros when creating spreadsheets

I'm using the PHP PEAR package to generate excel spreadsheets. I have data of type double with trailing zeros that need to be retained. How can I preserve this data without having the Worksheet::writeNumber function truncate the zeros? I've tried changing the format string in the pack function but no luck yet.

Upvotes: 0

Views: 171

Answers (1)

cweiske
cweiske

Reputation: 31078

Add a ' before it, e.g.

"'" . $number

Upvotes: 1

Related Questions