Gets the closest integer key to target in data.
target
data
Examples:
// Assuming numeric keys 1, 2, 3, 4 exist:getClosestIntegerKey(map, 3); // 3getClosestIntegerKey(map, 3.1); // 3getClosestIntegerKey(map, 3.5); // 4getClosestIntegerKey(map, 3.6); // 4getClosestIntegerKey(map, 100); // 4getClosestIntegerKey(map, -100); // 1 Copy
// Assuming numeric keys 1, 2, 3, 4 exist:getClosestIntegerKey(map, 3); // 3getClosestIntegerKey(map, 3.1); // 3getClosestIntegerKey(map, 3.5); // 4getClosestIntegerKey(map, 3.6); // 4getClosestIntegerKey(map, 100); // 4getClosestIntegerKey(map, -100); // 1
Map
Target value
Gets the closest integer key to
target
indata
.target
.Examples: