lib/lib.js
function (valueString) {
			// TODO: Detect other number formats (e.g. comma as decimal separator)
			var valueComp = valueString.split('.');
			var integralPart = valueComp[0];
			var fractionalPart = valueComp[1] || "0";
			while (fractionalPart.length < 8) fractionalPart += "0";
			fractionalPart = fractionalPart.replace(/^0+/g, '');
			var value = BigInteger.valueOf(parseInt(integralPart));
			value = value.multiply(BigInteger.valueOf(100000000));
			value = value.add(BigInteger.valueOf(parseInt(fractionalPart)));
			return value;
		}
function (valueString) {
			// TODO: Detect other number formats (e.g. comma as decimal separator)
			var valueComp = valueString.split('.');
			var integralPart = valueComp[0];
			var fractionalPart = valueComp[1] || "0";
			while (fractionalPart.length < 8) fractionalPart += "0";
			fractionalPart = fractionalPart.replace(/^0+/g, '');
			var value = BigInteger.valueOf(parseInt(integralPart));
			value = value.multiply(BigInteger.valueOf(100000000));
			value = value.add(BigInteger.valueOf(parseInt(fractionalPart)));
			return value;
		}
function ( valueString ) { // TODO: Detect other number formats (e.g. comma as decimal separator) var valueComp = valueString . split ( '.' ) ; var integralPart = valueComp [ 0 ] ; var fractionalPart = valueComp [ 1 ] || "0" ; while ( fractionalPart . length < 8 ) fractionalPart += "0" ; fractionalPart = fractionalPart . replace ( / ^0+ / g , '' ) ; var value = BigInteger . valueOf ( parseInt ( integralPart ) ) ; value = value . multiply ( BigInteger . valueOf ( 100000000 ) ) ; value = value . add ( BigInteger . valueOf ( parseInt ( fractionalPart ) ) ) ; return value ; }
Parse a floating point string as a Bitcoin value.

Keep in mind that parsing user input is messy. You should always display
the parsed value back to the user to make sure we understood his input
correctly.
Parse a floating point string as a Bitcoin value .