Utility that converts from prettyPrint format back to double (e.g. 10M = 10 000 000)
authorMikhail Okunev <mokunev@fb.com>
Mon, 31 Mar 2014 18:51:55 +0000 (11:51 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 4 Apr 2014 02:54:15 +0000 (19:54 -0700)
commit361946715a2d1a88b98d3f3ab30f7313262df96e
treea1edc98a9cb8bb8e2f7d84eb22378012e8be2fbe
parent72c2a0d3b47de74dd56b6750922e54ef333b4cbd
Utility that converts from prettyPrint format back to double (e.g. 10M = 10 000 000)

Summary: Utility is doing reverse of prettyPrint. This is a first sketch.

Test Plan:
1) We can reverse all tests from prettyPrint test and use for our function. For now I just reversed several of them
2) We can also test prettyPrint and prettyToDouble together by checking whether prettyToDouble(prettyPrint(X)) == X. This is implemented.

Reviewed By: marcelo.juchem@fb.com

FB internal diff: D1159879
folly/String.cpp
folly/String.h
folly/test/StringTest.cpp