test_class.file: runelite-client/src/test/java/net/runelite/client/util/QuantityFormatterTest.java
test_class.identifier: QuantityFormatterTest
test_case.body: @Test
  	public void stackSizeToQuantity() throws ParseException
  	{
  		assertEquals(0, QuantityFormatter.parseQuantity("0"));
  		assertEquals(907, QuantityFormatter.parseQuantity("907"));
  		assertEquals(1200, QuantityFormatter.parseQuantity("1200"));
  		assertEquals(10_500, QuantityFormatter.parseQuantity("10,500"));
  		assertEquals(10_500, QuantityFormatter.parseQuantity("10.5K"));
  		assertEquals(33_560_000, QuantityFormatter.parseQuantity("33.56M"));
  		assertEquals(2_000_000_000, QuantityFormatter.parseQuantity("2B"));
  
  		assertEquals(0, QuantityFormatter.parseQuantity("-0"));
  		assertEquals(-400, QuantityFormatter.parseQuantity("-400"));
  		assertEquals(-400_000, QuantityFormatter.parseQuantity("-400k"));
  		assertEquals(-40_543_000, QuantityFormatter.parseQuantity("-40.543M"));
  
  		try
  		{
  			QuantityFormatter.parseQuantity("0L");
  			fail("Should have thrown an exception for invalid suffix.");
  		}
  		catch (ParseException ignore)
  		{
  		}
  
  		try
  		{
  			QuantityFormatter.parseQuantity("badstack");
  			fail("Should have thrown an exception for improperly formatted stack.");
  		}
  		catch (ParseException ignore)
  		{
  		}
  	}
test_case.class_method_signature: QuantityFormatterTest.stackSizeToQuantity()
test_case.full_signature: @Test public void stackSizeToQuantity()
test_case.identifier: stackSizeToQuantity
test_case.invocations: assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity assertEquals parseQuantity parseQuantity fail parseQuantity fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void stackSizeToQuantity()
focal_class.declarator: SUFFIXES = {"", "K", "M", "B"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] SUFFIXES = {"", "K", "M", "B"};
focal_class.type: String[]
focal_class.var_name: SUFFIXES
focal_class.declarator: SUFFIX_PATTERN = Pattern.compile("^-?[0-9,.]+([a-zA-Z]?)$")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern SUFFIX_PATTERN = Pattern.compile("^-?[0-9,.]+([a-zA-Z]?)$");
focal_class.type: Pattern
focal_class.var_name: SUFFIX_PATTERN
focal_class.declarator: NUMBER_FORMATTER = NumberFormat.getInstance(Locale.ENGLISH)
focal_class.modifier: private static final
focal_class.original_string: private static final NumberFormat NUMBER_FORMATTER = NumberFormat.getInstance(Locale.ENGLISH);
focal_class.type: NumberFormat
focal_class.var_name: NUMBER_FORMATTER
focal_class.declarator: DECIMAL_FORMATTER = new DecimalFormat(
  		"#,###.#",
  		DecimalFormatSymbols.getInstance(Locale.ENGLISH)
  	)
focal_class.modifier: private static final
focal_class.original_string: private static final NumberFormat DECIMAL_FORMATTER = new DecimalFormat(
  		"#,###.#",
  		DecimalFormatSymbols.getInstance(Locale.ENGLISH)
  	);
focal_class.type: NumberFormat
focal_class.var_name: DECIMAL_FORMATTER
focal_class.declarator: PRECISE_DECIMAL_FORMATTER = new DecimalFormat(
  		"#,###.###",
  		DecimalFormatSymbols.getInstance(Locale.ENGLISH)
  	)
focal_class.modifier: private static final
focal_class.original_string: private static final NumberFormat PRECISE_DECIMAL_FORMATTER = new DecimalFormat(
  		"#,###.###",
  		DecimalFormatSymbols.getInstance(Locale.ENGLISH)
  	);
focal_class.type: NumberFormat
focal_class.var_name: PRECISE_DECIMAL_FORMATTER
focal_class.file: runelite-client/src/main/java/net/runelite/client/util/QuantityFormatter.java
focal_class.identifier: QuantityFormatter
focal_class.class_method_signature: QuantityFormatter.quantityToStackSize(long quantity)
focal_class.full_signature: public static synchronized String quantityToStackSize(long quantity)
focal_class.identifier: quantityToStackSize
focal_class.modifiers: public static synchronized
focal_class.parameters: (long quantity)
focal_class.return: String
focal_class.signature: String quantityToStackSize(long quantity)
focal_class.class_method_signature: QuantityFormatter.quantityToRSDecimalStack(int quantity)
focal_class.full_signature: public static String quantityToRSDecimalStack(int quantity)
focal_class.identifier: quantityToRSDecimalStack
focal_class.modifiers: public static
focal_class.parameters: (int quantity)
focal_class.return: String
focal_class.signature: String quantityToRSDecimalStack(int quantity)
focal_class.class_method_signature: QuantityFormatter.quantityToRSDecimalStack(int quantity, boolean precise)
focal_class.full_signature: public static synchronized String quantityToRSDecimalStack(int quantity, boolean precise)
focal_class.identifier: quantityToRSDecimalStack
focal_class.modifiers: public static synchronized
focal_class.parameters: (int quantity, boolean precise)
focal_class.return: String
focal_class.signature: String quantityToRSDecimalStack(int quantity, boolean precise)
focal_class.class_method_signature: QuantityFormatter.parseQuantity(String string)
focal_class.full_signature: public static synchronized long parseQuantity(String string)
focal_class.identifier: parseQuantity
focal_class.modifiers: public static synchronized
focal_class.parameters: (String string)
focal_class.return: long
focal_class.signature: long parseQuantity(String string)
focal_class.class_method_signature: QuantityFormatter.formatNumber(final long number)
focal_class.full_signature: public static synchronized String formatNumber(final long number)
focal_class.identifier: formatNumber
focal_class.modifiers: public static synchronized
focal_class.parameters: (final long number)
focal_class.return: String
focal_class.signature: String formatNumber(final long number)
focal_class.class_method_signature: QuantityFormatter.formatNumber(double number)
focal_class.full_signature: public static synchronized String formatNumber(double number)
focal_class.identifier: formatNumber
focal_class.modifiers: public static synchronized
focal_class.parameters: (double number)
focal_class.return: String
focal_class.signature: String formatNumber(double number)
focal_class.class_method_signature: QuantityFormatter.getMultiplier(String string)
focal_class.full_signature: private static int getMultiplier(String string)
focal_class.identifier: getMultiplier
focal_class.modifiers: private static
focal_class.parameters: (String string)
focal_class.return: int
focal_class.signature: int getMultiplier(String string)
focal_method.body: public static synchronized long parseQuantity(String string) throws ParseException
  	{
  		int multiplier = getMultiplier(string);
  		float parsedValue = NUMBER_FORMATTER.parse(string).floatValue();
  		return (long) (parsedValue * multiplier);
  	}
focal_method.class_method_signature: QuantityFormatter.parseQuantity(String string)
focal_method.full_signature: public static synchronized long parseQuantity(String string)
focal_method.identifier: parseQuantity
focal_method.invocations: getMultiplier floatValue parse
focal_method.modifiers: public static synchronized
focal_method.parameters: (String string)
focal_method.return: long
focal_method.signature: long parseQuantity(String string)